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.
The problem with one-line arrow functions is that if you want to debug them with console.log, it's fairly annoying since you have to add curly braces and a return statement.