That cool inline evaluation thing is called *Quokka* quokka.devtipsshow.com
@ablgmv6 жыл бұрын
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'.
@ColinRichardson6 жыл бұрын
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
@BuzzedAldrin16 жыл бұрын
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
@mtheoryx836 жыл бұрын
I don't watch this channel to really "save time". It's entertainment as well. But I understand what you meant. I think.
@ablgmv6 жыл бұрын
@@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.
@erikw41936 жыл бұрын
you missed the entire cookie break
@tyreldelaney6 жыл бұрын
I really like this kind of video. Just chatting about interesting things.
@ezekielsaturday26374 жыл бұрын
yeah, same here
@bjornkihlberg21036 жыл бұрын
Excluding fields with destructuring is really nice as well because it's not mutating anything. It's all pure.
@gokaygurcan57046 жыл бұрын
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.
@DoktorKumpel6 жыл бұрын
Also works with arrays [first, second, ...rest] = someArray
@YamenSharaf6 жыл бұрын
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.
@bramus6 жыл бұрын
Thanks for the mention! :)
@nikodemwrona10116 жыл бұрын
All of stuff was easy to follow and on point :)
@BrianDriesenga6 жыл бұрын
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. ;-)
@HygorZorak6 жыл бұрын
What is the vs code extension to show the contents of the variable?
@Victor_Marius6 жыл бұрын
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 :)
@natluenthaisong6 жыл бұрын
how you do the " //? " thing what tool is it?
@Sets_216 жыл бұрын
Quokka
@OfficialDevTips6 жыл бұрын
it's called Quokka. It has both a free tier and a pro tier. Check it out here kzbin.info/www/bejne/jWXFo3Sll6hlfsU or on their site quokkajs.com/
@natluenthaisong6 жыл бұрын
@@OfficialDevTips ,Sets, thank you very much
@ezekielsaturday26374 жыл бұрын
its Quokka - pretty cool stuff ⚡️✨ But depending on what you have running on your CMD, it might make you experience some system lags
@stephenjames29516 жыл бұрын
`let x = (...args) => { console.log(args); }` This kind of allows you to use "arguments" in an arrow function.
@ezekielsaturday26374 жыл бұрын
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.
@shadymohammed31976 жыл бұрын
You're awesome, guys 🔥
@RockCYP6 жыл бұрын
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.
@sachinthakur54936 жыл бұрын
Which extension are you using for live logs whenever you write certain variable or functions?
@ljprib3056 жыл бұрын
5:10 is great to pass React props around.
@markusgattol6 жыл бұрын
bring it on... complicated stuff is only complicated until understood... and that's why people meet here :)
@klausklemper59876 жыл бұрын
I love the humor !!
@oeschw76506 жыл бұрын
The rest operator is useful to get new objects with keys removed to test react components/props when fiddling w enzyme/jest ie
@TommiSvaerd6 жыл бұрын
I would want more videos like this! Maybe go a bit deeper into diffrent libraries/methods like promises, Observable etc? Cheers!
@OfficialDevTips6 жыл бұрын
Yay! For generators and Observable, check out MPJ's video here kzbin.info/www/bejne/g561nquwp9dnos0, David also did a video with Observable and physics here kzbin.info/www/bejne/famVZYafoLKZfdk
@tonysmarks35785 жыл бұрын
Sir, please tell me about the extension that you are using which can check your code.
@mtheoryx836 жыл бұрын
Really like this format as something to throw into the mix!
@RagePeanut6 жыл бұрын
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 !
@OfficialDevTips6 жыл бұрын
Yup you're right!
@williamchou90676 жыл бұрын
Curious what this ide plugin is to display the shape of objects!
@sakransaleh41106 жыл бұрын
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.
@catwhisperer9116 жыл бұрын
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 :)
@MrMine20006 жыл бұрын
Maybe changing it to '_email' can disable the warning?
@catwhisperer9116 жыл бұрын
@@MrMine2000 it might but I personally never use pseudo visibility makers because module patterns make that unnecessary.
@catwhisperer9116 жыл бұрын
Meant to say markers, not makers :)
@ryanf5916 жыл бұрын
Content wasn't too complex. It's good to get info for professional JS examples. Thanks
@FauroOficial5 жыл бұрын
what is the name of extension, less dont use console.log for see de result??
@jajasaria5 жыл бұрын
OH MY GOD! How come i only know this channel just NOW? love this kind of video. Keep it up guys. SUBSCRIBE
@vinisr126 жыл бұрын
JS feels like it's becoming Elixir more and more. The matching scheme is there.
@koodauskanava90966 жыл бұрын
Video starts at 1:40
@blackbird98546 жыл бұрын
So with the first thing, what if i want only small part of a huge object? is there a way to do it using ... notation?
@GifCoDigital6 жыл бұрын
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 }
@blackbird98546 жыл бұрын
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
@rothbardfreedom6 жыл бұрын
"I like a lot of things that people hate." Java programmer.
@kappe-n3v6 жыл бұрын
Oh this DEV-TIPS animation intro 👌 .... where do u got it from ? :D
@rolfnoduk6 жыл бұрын
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?
@ablgmv6 жыл бұрын
Why do you still use var?
@OfficialDevTips6 жыл бұрын
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.
@ablgmv6 жыл бұрын
@@OfficialDevTips Get it, thanks)
@j3bb9z6 жыл бұрын
Actually, Bluebird is still useful alternative to native promises, because it has better performance and some extra features.
@ragnarlothbrok3675 жыл бұрын
How to configure VSCode like that?
@compton83015 жыл бұрын
I'm also waiting for this answer.
@compton83015 жыл бұрын
Actually search for an extension called Quokka on vs code's marketplace and install it.
@herbertk92666 жыл бұрын
Thks cool tutorial
@tusharborole61556 жыл бұрын
how is a red and green dot on every line of code appear in your ide?
@OfficialDevTips6 жыл бұрын
Quokka
@jonwalzmusic6 жыл бұрын
I guess I didn't realize people weren't already using this stuff...
@stephenjames29516 жыл бұрын
Maybe it would be clearer if you don't assign a city variable. `let { city: _, ...newObj} = obj;` Using the _ to make it clearer that it is not used
@Chrosam6 жыл бұрын
0:16 nice animation ;)
@zeocamo6 жыл бұрын
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 :)
@agorafobicoMusica6 жыл бұрын
1:35 Let's create a var.. I mean...let...I mean...const
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
@OfficialDevTips6 жыл бұрын
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.
@szabikeresztes11576 жыл бұрын
Always like to be challenged mate!
@developingdeveloper74416 жыл бұрын
fluffykiiiiiins!!!
@CoryTheSimmons6 жыл бұрын
Give me ? chaining or give me death... so damn sick of `foo && foo.bar && foo.bar.baz` littering everything.
@oktavic7776 жыл бұрын
There is a proposal in Stage: 1 called "Optional Chaining". So `foo && foo.bar && foo.bar.baz` will be `foo?.bar?.baz`
@joel_ricci6 жыл бұрын
I couldn't agree more. If ES2018 should bring anything new, that should be it! 😩
@maged.william6 жыл бұрын
Yeah yeah guys be as JS nerdy all you wan't
@h3rteby6 жыл бұрын
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.
@ablanchi6 жыл бұрын
Yoansson
@jerzees6 жыл бұрын
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 KZbin 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?
@blackbird98546 жыл бұрын
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.
@jerzees6 жыл бұрын
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!
@aqua1236706 жыл бұрын
oh god please no! now they lost 1 subscriber of 305k. That's 0.000327868%, wow !! significant ! they must be desperate
@jerzees6 жыл бұрын
@@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
@jerzees6 жыл бұрын
@@dohnjoe342 well, feedback on why people leave is helpful sometimes