520 Views
This is yet another edition of ES6 in Depth. First time here? Welcome! So far we covered destructuring, template strings, arrow functions, the spread operator and rest parameters, object literal features in ES6, and last but not least: what “classes” really mean in ES6. Today is going to be about an assortment of simple language features coming our way in ES6 – let, const, and the scary-sounding “Temporal Dead Zone”. Like I did in previous articles on the series, I would love to point out that you should probably set up Babel and follow along the examples with either a REPL or the babel-node CLI and a file. That’ll make it so much easier for you to internalize the concepts discussed in the series. If you aren’t the “install things on my computer” kind of human, you might prefer to hop on CodePen and then click on the gear icon for JavaScript – they have a Babel preprocessor which makes trying out ES6 a breeze. Another alternative that’s also quite useful is to use Babel’s online REPL – it’ll show you compiled ES5 code to the right of your ES6 code for quick comparison. Shall we?