0

10 more Javascript Challenges!

 1 year ago
source link: https://dev.to/this-is-learning/10-more-javascript-challenges-3812
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Web Development (7 Part Series)

Do you know Javascript? After the success of the previous video, I've decided to make a second one with 10 more challenges to test your knowledge of the language.

These are 4 out of the 10 challenges you'll find in the video:


The ++ operator is really handy and you can put it either before or after the variable. But do you know the difference between the two?

let value = 3;
console.log(value++);
console.log(++value);

You can use _ and the letter e in numbers and they're still valid!

const THE_ANSWER = 1_2 + 3e1;

console.log(THE_ANSWER);

Isn't the output here supposed to be 7 on both cases? Actually, none of them is 7!

const x = "5";

console.log(1 + 1 + x);
console.log(x + 1 + 1);

Can you spot any unintended side effect here?

let me = { name: "Leonardo", socials: { twitter: "@balastrong" } };

let luca = { ...me };
luca.name = "Luca";
luca.socials.twitter = "@puppo92";

console.log(me);
console.log(luca);

If you're curious about the answers, you can find them in the video below. I hope you enjoy it!

In the video above, I go through all challenges and show the answer, but I also recorded a slower version where I actually explain them in more detail. If you're curious and want to learn more, you can find it here:

Let me know how many did you got right! :D


Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me ❤️
You can find it here:

Feel free to follow me to get notified when new articles are out ;)


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK