This is the second post of the JavaScript Quiz series! Make sure to check out the first one 🥳 Before starting this quiz, it may be useful to read t...
For further actions, you may consider blocking this person and/or reporting abuse
2/3
typeof
operator is always safe even with undeclared variables was wrong 😔. Watch out for TDZ!That’s great!!
Yeah there are some pitfalls when using the uninitialized variables haha, it’s not always very clear what you can and cannot do, I agree
This is a bit advanced that my understanding in JS but the explanations are well structured. The goodexplained details why my answers were incorrect summarized it very well an honestly made me say "why did I miss that" to myself.enjoyable to go through.I hope there will be part 3, can't wait.
BTW,what extension or app did you use to make this especially the code animation snippets?
That’s great, also feel free to let me know if you think I could improve my explanations anywhere. I’d like to include people from all levels! 😃
I use Keynote
Great article! Love it.
Would you mind sharing the name of the tool that you use for creating those awesome gifs?
For 3rd, if the variable was declared with var then it would have been undefined(hoisting). let and const are not hoisted.
Even let and const are hoisted (meaning, the engine does store them in memory, as seen in this gif), they just don’t get initialized with the default value of undefined 😃
Is this why a Reference Error is thrown? Because the JS engine knows not to use the global 'randomValue' variable? I.e., JS knows that the variable 'randomValue' is within the current block scope and thus the value of this locally-scoped 'randomValue' should be the preferred variable. So, although JS is aware of this local variable (because of hoisting) nonetheless the reference error is thrown because the variable cannot be referenced prior to being initialized (since we're using const here). Am I right about this?
btw.. ABSOLUTELY loving EVERYTHING you've done. From articles, your personal site, just amazing content all around. Thanks so much for all this amazing material!
I signed up to dev.to just to like your articles haha.
Keep up the great work!
avocados
2/3
I don't know much about generators/iterators but i will check that out.
Thanks for this kind of posts 👏🏼👏🏼
Thats awesome! Yeah generators are pretty cool once you get them, but you won’t see them that often like this “in the wild” lol
2/3
I haven't been around JavaScript for a while and the last question got me since I'm still from the "good" old var days and not fully familiar with how well JavaScript has adapted to certain features I know from other languages like Java.
Would definitely be happy to see this series continue
This made me realize I need to understand generator functions a ton better haha!! Great post and really well explained! Please post more :)
Even though its visual explanation is powerful, sometimes i feel that certain aspects of Javascript need more explanation on why they are bad choices and what the alternatives are. Like why is there no explanation that object mutations are inherently a bad idea and how problems can be solved using immutable data structures. That would make the ability to answer these questions trivial.
On 2.) I tried on the browser's console and on node.js but for..in was not working. I used for..of instead. Thanks for this mini quiz.
Wowowo! I got all three correct! 🤩 Thank you for making these interactive posts! Great explanations as always 🔥
Yay way to go! 🥳
Great!!
Thank you for these quizzes.😄
Both JavaScript quizzes are awesome and they are really helpful 😊
Add more quizzes and problems like these.
Really helps to improve a lot.😀
ReferenceError* instead of Erorr in the 3rd one :)
Darn typos :(
Very good article, how do you make these terminals and gifs?
It´s a JSFiddle code snippet. And with the icons probably is just hexa code... not sure. Or a library inside DEV, probably check the help docs section 🥳.
Doesn't 'shallow copy' comes into picture in 1st quiz?
3/3
2/3 :(
I forget for wait...of return values so i failed on question 2