This file contains 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 symbol1 = Symbol('coding'); | |
let symbol2 = Symbol('coding'); | |
console.log(symbol1 === symbol2); | |
var obj = {}; | |
obj[symbol1] = 5; | |
obj[symbol2] = 11; |
This file contains 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
interface IStudent { | |
id: string; | |
age: number; | |
} | |
interface IWorker { | |
companyId: string; | |
} | |
type IStudentAlias = IStudent; |
This file contains 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 symbol1 = Symbol(); | |
let symbol2 = Symbol(); | |
console.log(symbol1 === symbol2); | |
var obj = {}; | |
obj[symbol1] = 5; | |
obj[symbol2] = 11; |
This file contains 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 symbol1 = Symbol(); | |
let symbol2 = Symbol(); | |
var obj = { | |
a: 13, | |
[symbol1]: 5, | |
[symbol2]: 11 | |
}; | |
let props = []; |
This file contains 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 symbol1 = Symbol(); | |
let symbol2 = Symbol(); | |
var obj = { | |
a: 13, | |
[symbol1]: 5, | |
[symbol2]: 11 | |
}; | |
let props = Object.getOwnPropertyNames(obj); |
This file contains 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 props = Object.getOwnPropertyNames(obj); | |
console.log(props); // ["a"] |
This file contains 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 serialized = JSON.stringify(obj); | |
console.log(serialized); // {"a":13} |
This file contains 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 symbol1 = Symbol('coding'); | |
let symbol2 = Symbol('blast'); | |
var obj = { | |
a: 13, | |
[symbol1]: 5, | |
[symbol2]: 11 | |
}; | |
This file contains 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 symbol1 = Symbol('coding'); | |
let symbol2 = Symbol('blast'); | |
var obj = { | |
a: 13, | |
[symbol1]: 5, | |
[symbol2]: 11 | |
}; | |
This file contains 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
function* simpleGenerator() { | |
yield 1; | |
yield 4; | |
} | |
let iterator = simpleGenerator(); | |
let iteratorResult = iterator.next(); | |
console.log(iteratorResult); |