Learning ES6 (FINALLY)

Some amazingly great changes are in ES6, but I wanted to start out simple by highlighting a very useful syntax introduction: the let command.

In a nutshell, let introduces block-level scoping to variables.

What does that mean? I’ll show you:

<script>

var x = 10;

if(x) {
    var x = 92;
}

console.log(x);

</script>

What will happen when you run this snippet? The console will display something similar (literally) to “92”

> 92

Now, if you run this snippet using let like so:

<script>

var x = 10;

if(x) {
    let x = 92;
}

console.log(x);

</script>

console.log will display “10”.

> 10

So, block-level scoping means we can isolate scope within control structure blocks in the same way as we can control scope within functions!

(also, if you haven’t opened up your devtools, now is a good time to do so. then you can copy/paste the code between the <script> tags to run it)

I love this feature. I’m super late to the ES6 party, but better late then never!

The Javascript Bug is Back

Since working on a recent JS App for a project, I’ve caught the JS Pattern and framework bug again!

Enter Backbone.js.

Just diving into the docs for this now, but so far I am very impressed. It’s been a long while since I’ve really explored some new JS tech, so Backbone.js has been a welcome change of pace.

I see this library and Phantom JS used together to make some seriously rowdy music.