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 students = [ | |
{ | |
name: "Indrek", | |
score: 33.99 | |
}, | |
{ | |
name: "John", | |
score: 50.35 | |
}, | |
{ |
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 students = [ | |
{ | |
name: "Indrek", | |
score: 33.99 | |
}, | |
{ | |
name: "John", | |
score: 50.35 | |
}, | |
{ |
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 students = [ | |
{ | |
name: "Indrek", | |
score: 33.99 | |
}, | |
{ | |
name: "John", | |
score: 50.35 | |
}, | |
{ |
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 names = ["Indrek", "Trevor", "Anna", "Buck"] | |
const namesToLowerCase = name => name.toLowerCase() | |
const lowerCaseNames = names.map(namesToLowerCase) | |
console.log(lowerCaseNames); // ["indrek", "trevor", "anna", "buck"] |
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 names = ["Indrek", "Trevor", "Anna", "Buck"] | |
const namesToLowerCase = name => name.toLowerCase() | |
const lowerCaseNames = names.map(namesToLowerCase) | |
console.log(lowerCaseNames); // ["indrek", "trevor", "anna", "buck"] |
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 names = ["Indrek", "Trevor", "Anna", "Buck"] | |
const lowerCaseNames = names.map(name => { | |
return name.toLowerCase() | |
}) | |
console.log(lowerCaseNames); // ["indrek", "trevor", "anna", "buck"] |
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 name = "Indrek" | |
name = "Adam" | |
const family = { name: "John"} | |
name = family.name | |
console.log(name); // "John" |
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 name = "indrek" | |
name = "Adam" | |
const family = { name: "John"} | |
name = family.name | |
console.log(name); // "John" |
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 name = "Indrek" | |
name = "Adam" // "TypeError: Assignment to constant variable." | |
// ______ // | |
let surname = "Lasn" | |
surname = "Smith" |
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 dogs = { | |
name: "Sam", | |
age: 10, | |
} | |
const valuesMappedToArray = Object.values(dogs); | |
console.log(valuesMappedToArray); // ["Sam", 10] | |