Modern JavaScript Part 17: Everything new in ES2016

ES2016 introduced only two new features : Array.prototype.includes() The exponential operator   Array.prototype.includes() The includes() method will return true if our array includes a certain element, or false if it doesn’t. let array = [1,2,4,5]; array.includes(2); // true array.includes(3); // false   Combine includes() with fromIndex We can provide .includes() Read more…

Modern JavaScript Part 12: ES6 Classes

Quoting MDN: classes are primarily syntactical sugar over js’s existing prototype-based inheritance. The class syntax does not introduce a new object-oriented inheritance model to JavaScript. That being said, let’s review prototypal inheritance before we jump into classes. function Person(name,age) { this.name = name; this.age = age; } Person.prototype.greet = function(){ Read more…