PHPnews.io

Overview for 'wesbos'

Temporal Dead Zone ☠️

Written by Wes Bos / Original link on Sep. 1, 2016

Let’s talk real quick about the Temporal Dead Zone. This is a bit of a boring topic, so I’m going to try and make it at least a little fun for you. This is something that you probably won’t come across too often, but it’s helpful to know in case someone ever slings it out in an interview. You’d be…


ES6 Block Scope is The new IIFE

Written by Wes Bos / Original link on Aug. 31, 2016

You can probably see where let and const are going to be useful: if you need to scope something to a block, or if you want to make a variable that cannot be changed by accident or on purpose. Let’s take a look at a couple of more examples of when it might be useful. The first one is replacing the…


Quick Tip: Use let with for Loops in JavaScript

Written by Wes Bos / Original link on Aug. 31, 2016

The other problem using let and const will fix is with our for loop. This is something that you probably have all run into with your regular for loop, like one that will count from zero to nine: for(var i = 0; i < 10; i++) { console.log(i); } Problems that arise here are two things: First of all…


ES6 let VS const variables

Written by Wes Bos / Original link on Aug. 30, 2016

In the last post we learned all about how scoping works with JavaScript let, const and var variables. We now know that var is function scope, and now we know that let and const are block scope, which means any time you’ve got a set of curly brackets you have block scope. Now, we need to know you ca…


How let and const are scoped in JavaScript

Written by Wes Bos / Original link on Aug. 30, 2016

There are a couple new ways to declare variables in ES6 that help us out with scoping. We can declare variables with var, which we’ve always used, but now we can use let and const to declare variables too. These two have some attributes about them which are going to be helpful for us in creating va…


ES6 for Everyone!

Written by Wes Bos / Original link on Jul. 19, 2016

The last few months I’ve been hustling away at my next JavaScript course – ES6 for everyone. Today I’m super excited to launch it! ES6.io ES6 for Everyone is a premium training course to strengthen your core JavaScript skills and master all that ES6 has to offer. ES6 is a major update to JavaScript…