JavaScript ES6 - Symbols

preview_player
Показать описание
This short video talks about the newest addition to the JavaScript type system, Symbols! We walk through an example to demonstrate their usefulness.
Рекомендации по теме
Комментарии
Автор

2:35 - No, objects do not return true when compared like that.

WorstDeveloper
Автор

5:07 you mean element[isMoving] I think

wolas
Автор

What if the element you're adding the symbol to already has a property of the same name ("isMoving") in this example, with say a boolean value - how would you ensure you're checking the symbol and not the boolean if they're both stored with the same name?

JustinBurkard
Автор

please do the in-depth video on js classes

yemiolulana
Автор

could you paste the article url that you mentioned in the video here? thanks

hoangtrieukhang
Автор

the keyboard noise in these videos is maddening... great content though

cunning_jams
Автор

null is not a type. typeof null === 'object'

yx
Автор

I think you have forgotten NaN is also a type in Javascript. For example, typeof NaN is "number".

eddie
Автор

Symbols are great and simple concept, but almost always poorly explained (including this video). This is just a primitive value that is unique for granted, not by its representational value (because it doesn’t have any). Imagine you invite thousand of black cats to the party and you want to somehow distinguish them later. You will cut the paper randomly and then stick one piece on each cat, taking photo of each. Then you will find out which cat was it just by the shape of the paper cut. And you don’t really care about the shape of the paper per se. You care just to know which one it was. It’s the same with symbols! They don’t have any valuable meaning, but you will be able to know for sure it was the one, because nobody can make an identical one by accident. The author seems to not be understanding that the value passed in the constructor is just for debugging. If you console.log your symbol, this value will appear there. But it is NOT meant to be used any other way. Symbols are only to be compared to!

rafadydkiemmacha
Автор

Dear friend you completely failed to transfer knowledge with your explanation.

diegoburlandotheinformal
Автор

Yeah pretty poor explaination. DEFINITELY meant
element[isMoving]
WOW

devPunks