Site Tools


es6

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
es6 [2017/11/15 22:42]
conovaloff
es6 [2017/11/15 22:43] (current)
conovaloff
Line 4: Line 4:
   * () => {. . .}  # arrow function (this in out of scope, not in function)   * () => {. . .}  # arrow function (this in out of scope, not in function)
   * let   * let
 +  * class 
 +
 +<​code>​
 +class baseModel {
 +  constructor(options = {}, data = []) { // class constructor
 +    this.name = '​Base'​
 +    this.url = '​http://​azat.co/​api'​
 +    this.data = data
 +    this.options = options
 +  }
 +
 +    getName() { // class method
 +      console.log(`Class name: ${this.name}`)
 +    }
 +}
 +</​code>​
  
 https://​dev.to/​sarah_chima/​enhanced-object-literals-in-es6-a9d \\ https://​dev.to/​sarah_chima/​enhanced-object-literals-in-es6-a9d \\
 https://​webapplog.com/​es6/​ https://​webapplog.com/​es6/​
es6.txt ยท Last modified: 2017/11/15 22:43 by conovaloff

Page Tools