ES6 Activity

Back in the bad old days, when ES5 was all we had, we often cited this meme to inform fellow programmers of our pain.

The phrase "JavaScript: The Bad Parts" came to describe all that was janky and illogical with JavaScript.

Curious about more bad parts? Here's a collection of them you can read through.

ES6: Fixing the Bad Parts

ES6 did a lot to fix common pain points with ES5 such as hoisting, reference, and scope related errors. It also added some common syntactic sugar that made JavaScript look and feel like object-oriented languages.

Activity: Let's Dig In

1. Take a read through this FreeCodeCamp article.

2. Read a counter-argument by someone who's less enthralled with ES6's changes

3. Think about and write down an answer to the following questions

1. Why are there "bad" parts of JavaScript? What makes them bad?
2. Of the 5 "fixes" mentioned in the article, which one do you think is most beneficial?
3. Walk through the first code example in the article - where the bonus variable is hoisted in a way that breaks the code. Do you understand why it breaks? 
4. Why was "var" a problem in the first place? What is hoisting? Why is it there?
5. Does array/object destructuring make the JavaScript language more or less confusing in your opinion?
6. How much do you think ES6 "fixes" versus "hides"? Defend your answer.

4. Discuss! Your instructor will either put you in a group or lead a full class discussion based around the questions you just answered.

Resources

Last updated