Arrays have the added benefit of not having to add unnecessary variables to your namespace if you only wanted to grab the third item of the array for example const [, , third, ...rest] = someArray; Now you don't have first and second variables if you don't need them.
i love to see you videos, remind me of the time when i also only got like 3 years of exp. keep on coding guys, you will learn to understand the world of programing one day :)
it's called Quokka. It has both a free tier and a pro tier. Check it out here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-W4brAobC2Hc.html or on their site quokkajs.com/
And gonna save twenty six minutes of your time 1. let { city, ...restOfTheObject } = sourceObject restOfTheObject will have all other properties of the sourceObject without 'city' property. 2. regexp match() is cool. 3. 'for ... of' is here for iterating all iterable objects. Also can be used for asynchronous operations, just insert 'await' just after the 'for'.
I didn't know const { city, email, ...restOfObject } = originalObject; was a secret that noone knew about.. Tho, I would have done let filteredObject; { const { city, email, ...rest } = originalObject; filteredObject = rest; } That way city and email variables are not littering your active variables
You could also use: Promise.all(ArrayOfItems.map(async (Item) => { const ret = await asynchronousMethod(item); // Do something with ret })); If you want to wait on a bunch of promises based on array data. I believe this is also a bit more efficient
@@mtheoryx83 Yeah, I'm sorry a bit for this comment. But on the other hand I wanted write it too much and couldn't do anything with myself. Sorry again. I can remove it.
According to Wikipedia article, the first manual models, were developed in the 1860s, and the first motorized designs appeared at the turn of the 20th century.
To answer David's question, for me it wasnt difficult to understand, I already use most of these Es6 features so I found it pretty cool. But the for await was a cool thing to witness tho.
Would love to see further discussion of features in ES2018 that you guys see as important. Also, please post links to the important stuff (where to order that fika food online)! By the way, the first vacuum sweepers (precursor to vacuum cleaners) were introduced in the 1860's. ;-)
I love you this episode very much. Especially when you are talking about the ES6 2018 feature. Because I had today I am study little bit about destructuring. I think care if you can make you episode add different features of JavaScript base then I think that show will be more effective and more enjoyable for us.
const {email, ...userWithoutPII} = user will unfortunately cause a linting error of assigned value is never used for email. In eslint you can turn off the rule so it won't cause the error. just thought you'd like to know :)
11:14 Actually, if you didn't get a first name theMatch[1] would be undefined. You can even see that at 11:30 when you changed the regular expression. Still, I'm looking forward to named capturing groups, will be a game changer !
Guys thank you for the video and i really like you why of making it but realize that you focus only on the developing of the channel and you forget about the design part of it the channel name was dev tips for designers what the last time you made video about html templating or ui/ux trends or visual design ... Etc i hope you get my point
We know what you mean. Problem is we are pretty terrible designers... We're hearing you though! There are many topics around design stuff tied to development that is not as techy as this video.
It depends on if you are looking for function scope (var) or block scope (const, let). Also it is just plain old habit to use var to not have to bother about browser compatibility. Mostly being lazy to be honest.
While I understand the destructuring rest hack, I think it's pretty terrible for readability. Also, declaring the "email" variable just for the side-effect? 🤨 I'd rather see lodash.omit and lodash.pick brought in as Object.omit and Object.pick. They're dead simple to understand.
Wow, that RegExp feature I saw it in python few days ago and I thought I probably will never use it. But now, when I found out that is in javascript also, I changed my mind. Thanks for changing my mind :)
A note on 'for...of' -> its used for arrays, 'for...in' is used for objects. As for the spread object yes its new but when using Arrays you could do that since es2015 i believe.
You keep explaining destructuring but rarely use it by default. Would you be able to use it more often when doing other stuff so it's more familiar to people?
Yay! For generators and Observable, check out MPJ's video here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-MmRmxzrr4lk.html, David also did a video with Observable and physics here ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Gx24SikMfGw.html
If you want those small parts of the huge object in their own variables just omit the ... and just use destructuring. bigObj = { name : 'Bob', age : 32, sex : 'male', lots more key value pairs} {name, age} = bigObj You now have a variable name and a variable age. If however you want those "small parts" of the huge object all in one variable in their own object just create a new object and pick the parts you want to put in it. smallObj = { name : bigObj.name, age : bigObj.age }
GifCo also you can create and deconstruct object at the same time eg. const smallObj = { name, age, sex } = obj 'problem' with that is that you also create all the variables, i hope you could bo it better with ... notation, oh well thanks for answer anyways
Just watched the first few minutes, but why would call destructing with the spread operator a "sort of like a hack!"? Its the intended use, and you seem so confused about the entire feature, the other guy responds like its magic, its been around for a while. Is this just RU-vid acting or what is the intention? Sorry dont want to be a downer but I used to follow this channel with the "previous owner", I dont know who you guys are and im trying to determine if I should keep following or not. Feels like the skill level has dropped quite a bit, is this channel now targeting more like beginners?
jerzees What if they do that on purpose? I'm pretty sure most of people don't watch these videos if they already know all that. So if one of them doesn't understand or pretends to, people watching this videos that acually don't understand the subject get more examples or explanation, asking questions is really good way to learn but you can't ask pre recorded video a question so they do that for you.
That was kind of my question, if this is "an act". Either way, my personal preference is to watch people with knowledge talk and explain a feature, show examples in a normal way. Like Jake Archibald and Surma does in Google´s HTTP203 for example. Anyway, just gonna unsubscribe, dont feel like this channel speaks to my taste anymore, bye!
@@aqua123670 well, you know there might be more people that feel the same way? And if you add them together... As a channel owner, I believe they want to know what the viewers think, and why they might leave