Thank you for the exercises and once again I appreciate you having us pull back knowledge and figure out that we can't use a typical for loop for Objects because they are non itterables, and we had to use a for of loop. My only trouble was I searched on google and it had me use a for in loop, and when I was trying to run the code Everything on exercise 2 would print out Not implemented yet, I also tried to do Object.values(enemy) instead of Object.values(enemies) but after watching your solution and figuring it out on my own afterwards I completely understand the process. Thank you again Nader for the exercise and the clear explanations they are very much appreciated.
@TechWithNader Жыл бұрын
You're very welcome! This is an important realization to have, nice work! I actually purposefully avoided the for-in loop and I encourage you to only use it for debugging and not in your daily code. You can see why later when we get to prototypes, but it's a bit dangerous in how it works internally 😊
@nobody200226 ай бұрын
for exercise 3: we can also write like this const points = [3,4,1,0,1,5,6]; for (const point of points) { switch (true) { case point
@InsanEzln Жыл бұрын
Why can't we use 'or' like case 0 || 1 || 2 ? i tried and it does not work
@TechWithNader Жыл бұрын
Good question! Switch matches on primitives by type directly, so we have to list them all out explicitly but we can use fall through for this, for example: case 0: case 1: case 2: { console.log(“matches all 3”); break; }
@horrorfying28842 жыл бұрын
do you know svelte?
@TechWithNader2 жыл бұрын
I’ve used Svelte to build a couple small projects when it first came out to compare it to React but haven’t gotten a chance to use it recently 😃 I like the concept behind it though.
@horrorfying28842 жыл бұрын
@@TechWithNader sounds good! was hoping you'd cover svelte someday but at least i have the javascript vids!
@TechWithNader2 жыл бұрын
@@horrorfying2884 So many videos to make, so little time haha! Let me know if you have other ideas as I’m compiling all the feedback I receive to inform future content 😊