Welcome to one of the articles about destructuring a coding quiz from Social Media. This time, we check out a very funny sorting algorithm. Be prepared to order numbers with timeouts!
The Snippet
const numbers = [29, 11, 201, 7, 99, 912, 39, 31];
for (let num of numbers) {
setTimeout(() => console.log(num), num);
}
Welcome to the series about destructuring a JavaScript quiz from Social Media. This Sunday, you'll learn about the one API you should never use: eval.
⚠️ Executing JavaScript from a string is an enormous security risk. It is far too easy for a bad actor to run arbitrary code when you use eval(). Read more at MDN
The Snippet
function challenge(input){
eval(input.toUpperCase())
}
// provide an input that makes function challenge call alert(1)
challenge('alert(1)');
Welcome to my series about destructuring one of those frequently shared JavaScript quizzes on Social Media. This is the fourth episode featuring one of the oldest JS tricks!
Peer reviews are a broad topic with infinite things to learn and discuss. And they can be scary, especially when you have just started your professional tech career. In this post, I will share some thoughts on the worst (is it?) thing that can happen: your PR is ripped into pieces.
I just wanted to share a quick tip I learned on Twitter a while ago. It was about how you can wrap curly braces around a variable in your console.log statements to transform it into an object and have the variable name automatically prefixed.