This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let count = 0; | |
for (let [a, b] of [[5,10]]) { | |
console.log( `${a} ${b}` ); | |
count++; | |
} | |
console.log( count ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
devices: { | |
smoke_co_alarms: { | |
Po6f9vz - ITe6Rst42IPA1Saa5Kl2ZoQm: { | |
battery_health: "ok", | |
co_alarm_state: "ok", | |
device_id: "Po6f9vz-ITe6Rst42IPA1Saa5Kl2ZoQm", | |
is_manual_test_active: false, | |
is_online: true, | |
last_connection: "2016-04-28T13:35:34.320Z", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project { | |
getTaskCount() { | |
return 50; | |
} | |
} | |
class SoftwareProject extends Project { | |
getTaskCount() { | |
return 100; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project { | |
getTaskCount() { | |
return 50; | |
} | |
} | |
class SoftwareProject extends Project { | |
getTaskCount() { | |
return super.getTaskCount() + 25; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let project = { | |
getTaskCount() { | |
return 50; | |
} | |
} | |
let softwareProject = { | |
getTaskCount() { | |
return super.getTaskCount() + 25; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project { | |
constructor() { | |
this.location = 'Mazatlan'; | |
} | |
} | |
class SoftwareProject extends Project { | |
constructor() { | |
super(); | |
this.location = this.location + ' beach'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project { | |
static getDefaultId() { | |
return 1; | |
} | |
} | |
Project.getDefaultId(); | |
// 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Project { | |
constructor() { | |
console.log( new.target ); | |
} | |
} | |
class SoftwareProject extends Project { | |
constructor() { | |
super(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Blog { | |
} | |
let b = new Blog() | |
console.log( blog.toString() ); | |
// [object Object] | |
Blog.prototype[Symbol.toStringTag] = 'My Awesome Blog Class'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a = {a:1}, b = {b:2}; | |
let target = {}; | |
// skips non-enumerable properties | |
Object.defineProperty(b, 'c', { | |
value: 3, | |
enumerable: false | |
}); |