A number of JavaScript libraries these days, require strong understanding of the ES6 language. If you want to comfortably work with libraries like Redux, ReactJS, Relay, GraphQL it’s important to understand some of the latest concepts.
My first article/video in the series talks about Object Destructuring.
The second one, discusses Array Destructuring.
The third topic is on writing relaxed JSON.
The fourth topic is about using Rest operators.
The fifth topic is about using Spread operators.
The sixth topic discusses Template Strings.
The topic I have discussed here is classes and objects.Gone are the days of treating functions as classes and using prototype for inheritance. OO is pretty easy in JavaScript now. As you can see below, it’s pretty straightforward to create classes and objects and use inheritance.
class Employee{ constructor(name,salary){ this.name = name this.salary = salary } work(){ return `Employee ${this.name} is yawning` } } let sam = new Employee("Sam",5000) console.log(sam.work()) class Manager extends Employee{ constructor(name,salary,stockOptions){ super(name,salary) this.stockOptions = stockOptions } work(){ return `${super.work()}; Manager ${this.name} is snoring` } } let john = new Manager("John",10000,100000) console.log(john.work())
You can watch the video here