@recursivecodes
Todd Sharp
You’ve been a developer for a while. You’re familiar with JavaScript and written plenty of apps in your day. But you’ve been out of the loop for a while. There’s been a lot of changes in the JS world and after this talk you’ll be up to speed and ready to get started with modern day JS.
@recursivecodes
A standard which represents a scripting language specification called ECMAScript.
@recursivecodes
ECMA-262 is...
A general purpose scripting language that conforms to the ECMAScript specification
@recursivecodes
JavaScript is...
A confusing bit of history is that JavaScript was created in 1996. It was then submitted to Ecma International in 1997 for standardization, which resulted in ECMAScript. At the same time, because JavaScript conformed to the ECMAScript specification, JavaScript is an example of an ECMAScript implementation.
@recursivecodes
That leaves us with this fun fact: ECMAScript is based on JavaScript, and JavaScript is based on ECMAScript.
ECMAScript 5 (ES5): The 5th edition of ECMAScript, standardized in 2009. This standard has been implemented nearly completely in all modern browsers
ECMAScript 6 (ES6)/ ECMAScript 2015 (ES2015): The 6th edition of ECMAScript, standardized in 2015. This standard has been almost completely implemented in most modern browsers.
ECMAScript 2016 (ES2016/ES7): The 7th edition of ECMAScript. It was released in 2016. This standard has been partially implemented in most modern browsers.
ECMAScript 2017 (ES2017/ES8): The 8th edition of ECMAScript. It was released in June, 2017. This standard has been partially implemented in most modern browsers.
@recursivecodes
@recursivecodes
@recursivecodes
@recursivecodes
@recursivecodes
if (true) {
let a = 'a';
let a = 'b';
}
You can not redeclare a variable using let within the same function or block scope. Attempting to do so will raise a SyntaxError.
@recursivecodes
@recursivecodes
Use let when you will need to reassign the value of the variable (IE: a for loop index or a boolean flag, etc).
Use const pretty much everywhere else. Note, const means it can not be changed, but it does not mean the value is immutable. You can assign key values to an object declared with const and you can push/pop/slice/etc an array declared const. Immutability (to a certain extent) can be achieved with Object.freeze() or third party code.
You probably won't use var that much anymore.
@recursivecodes
A less repetitive way to assign properties of an object
@recursivecodes
Using dynamic key names in object literals.
@recursivecodes
function login( user='admin', password='hunter2') {
return { joking: true };
}
@recursivecodes
function rest(...args) {
console.log(args);
}
console.log( rest( 1, 2, 3 ) );
// [1,2,3]
Access an arbitrary amount of (undefined) function parameters as an array
@recursivecodes
JavaScript classes, introduced in ES6, are primarily syntactical sugar over JavaScript's existing prototype-based inheritance.
The class syntax does not introduce a new object-oriented inheritance model to JavaScript.
@recursivecodes
Give us the ability to create modularized, reusable code chunks so that our codebase is well structured and reusable.
@recursivecodes
Easier and cleaner string concatenation!
@recursivecodes
Short, clean and concise way to declare a function with slight differences in scope handling compared to traditional functions
@recursivecodes
Are handy, but they are NOT a 'silver bullet'!
@recursivecodes
Synchronous
Code evaluated in sequence and executed one after another. Each statement waits for the previous to complete before executing (Usually blocks further execution)
Asynchronous
Subsequent lines of code do not wait for completion before they are executed. Best example: Ajax request.
(Non-blocking)
@recursivecodes
The Promise object represents the eventual completion (or failure) of an asynchronous operation, and its resulting value.
@recursivecodes
Simplified XMLHttpRequest that returns a Promise
@recursivecodes
A "cleaner" way to work with promises and other asynchronous operations
@recursivecodes
@recursivecodes
@recursivecodes
* weak means the object key references are weakly held meaning the objects referenced by those keys are subject to garbage collection
All of these types maintain insertion order
@recursivecodes
@recursivecodes
Your feedback is welcomed and encouraged!!
@recursivecodes
@recursivecodes