![]() ![]() In this snippet, we use a comma without providing a name for the item in the array we don't need. Here's a common example where object destructuring would come in handy: If you've never seen the syntax for it before, it can be a bit confusing, but it's straightforward to understand once explained! # Object destructuring # DestructuringÄestructuring is an easy way to extract items from an object or array. Again, if you aren't sure what this is or when you need it, reading about lexical this first may only confuse you. We won't be covering the lexical this scope with arrow functions in here, but you can Google around if you're still curious. You can create a variable and give it an anonymous arrow function as the value, though (as seen with the doubleAge and filter variables).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |