5 MORE Must Know JavaScript Features That Almost Nobody Knows

preview_player
Показать описание
🚨 IMPORTANT:

JavaScript is a vast language with tons of features and it is impossible to know them all. In this video I will be covering 5 more features in JavaScript that nobody knows but are incredibly useful.

📚 Materials/References:

🌎 Find Me Here:

⏱️ Timestamps:

00:00 - Introduction
00:24 - Block Statements
03:36 - in Keyword
05:49 - Template Literal Functions
11:12 - Generator Functions
14:57 - Dynamic Module Imports

#JSTips #WDS #Top5JS
Рекомендации по теме
Комментарии
Автор

One fun note: generators are the foundation of async/await syntax. Under the hood, when you create an async/await function, the JS engine creates a recursive generator where all the awaits are converted into yields, and the promises you're awaiting get a .then tacked on which calls the generator's next() method. Without generators, async/await wouldn't be possible :)

IceMetalPunk
Автор

That dynamic import part was mindblowing. I can see it being useful when you're making API calls to refresh the data of an application. There are many instances where the source is only updated weekly or monthly so instead of making API calls with every load. You could do some date checking first and then refresh the data if it is out of date. Great stuff as always Kyle!

StevenHoodlebrink
Автор

the curly bracket thing is super cool, never knew that!

deonrich
Автор

“Example isn't another way to teach, it is the only way to teach." - A. Einstein

ahmaddynugroho
Автор

Those are some awesome things I'm going to immediately forget the next time I have to write any JavaScript...

WeaselBass
Автор

Glad you're continuing on with these. Definitely learning a thing or two that I didn't know. Much love as always Kyle. See you soon!

CodingNuggets
Автор

Dynamic imports are a very cool feature! Definitely useful, but not well known 👍.

patrickc.
Автор

Nice Video Kyle! Enjoyed it like most of them!

5:40 The in operator also looks at the prototype chain. Using will search only for that property within the object. But in operator will search for the property within the object and if not found will search the prototype chain. In certain cases we need to consider that.

danvindsouza
Автор

I've been watching videos of JS things I've never heard of, and the dynamic import feature blows me away. This is truly a game changer.

spaces
Автор

Cool video, just a slight bugbear of mine: <strong> doesn't make it more semantic, if anything you made it less semantic. Stick with <b> in that context. Strong doesn't simply make the text bold, it strongly emphasizes it.

NickoSinclair
Автор

Loving it! supposedly simple things like scopes open up completely new possibilities. Thx for your videos I'm always inspired

christophalbrecht
Автор

That id generator example was great, very intuitive use case!

xXYourShadowDaniXx
Автор

In the generator you could have just done `yield id++` since the ++ executes after the yield statement. You probably already know this but just in case, you can also reverse that syntax (`yield ++id`) to ensure the ++ executes *before* the yield statement :)

AlexFord
Автор

Template literal functions is really useful. I wish I knew before because I can now use it to sanitize user generated inputs for dynamically rendered content

liondeluxe
Автор

me see the thumbnail: "hey.. I know that one"
also me start watching the video: "wha-- "

elmyllo
Автор

“When you have a specific use case for them, they are really useful”
Well I can’t say that’s untrue

nitsanbh
Автор

For the template literal functions, I prefer them like this:
const user_profile = (firstName, hobby) => `
<article class="user-profile-wrapper">
<div class="display-name-wrapper">
<p class="display-name>${ firstName }</p>
</div>
<div class="tags-list">
<p class="tag tag-hobby clickable">${ hobby }</p>
</div>
</article>
`
And call like += user_profile(newUser.firstName, newUser.hobby)

jaideepshekhar
Автор

I get ragged on constantly for talking too fast; once I taped a kind of infomercial and they needed four takes at one point to get useful footage because even me purposely slowing myself down left them clueless at how to make me clearly enunciate.

So I really appreciate that I can hear and understand you perfectly fine at 2x speed. It saves me time but also means that you're not losing people like I am with my meandering babble speed.

vincentjohnflorio
Автор

It's just amazing that you are able to explain these concepts so easily.

tajuddinkhan
Автор

I'm currently working on a Todoist clone and I never use Switch Statements, but when you mentioned it, I was literally working on a perfect part of the app to add a Switch Statement!

IkraamDev