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
import { someData } from ‘./path/to/file.js’; |
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
import * as upToYou from ‘./path/to/file.js’; |
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 Person { | |
constructor () { | |
this.name = ‘Douglas Adams’; | |
} | |
} | |
const person = new Person(); | |
console.log(person.name); //logs: ‘Douglas Adams’ |
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 Person { | |
name = ‘Douglas Adams’; | |
} | |
const person = new Person(); | |
console.log(person.name); //logs: ’Douglas Adams’ |
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 Person{ | |
name = ‘Douglas Adams’; | |
printAuthorsName () { | |
console.log(this.name); // this is required to refer to the class! | |
} | |
} | |
const person = newPerson(); | |
person.printAuthorsName(); |
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 Person{ | |
name = ‘Douglas Adams’; | |
printAuthorsName = () => { | |
console.log(this.name); | |
} | |
} | |
const person = new Person(); | |
person.printAuthorsName(); |
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 Human{ | |
species = ‘human’; | |
} | |
const person = new Person(); | |
class Person extends Human{ | |
name = ‘Douglas Adams’; | |
printAuthorsName = () => { | |
console.log(this.name); | |
} |
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
const oldArray = [1, 2, 3]; | |
const newArray = […oldArray, 4, 5]; // This now is[1, 2, 3, 4, 5]; |
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
const oldObject = { | |
name: ‘Douglas Adams’ | |
}; | |
const newObject = { | |
…oldObject, | |
age: 42 | |
}; |
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
{ | |
name: ‘Douglas Adams’, | |
age: 42 | |
} |