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
const myObj = { | |
prop: "Nome" | |
}; | |
myObj.prop = "William"; | |
console.log(myObj.prop) // "William"; |
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
var myArray = [1, 2, 3, 4]; | |
var firstValue = myArray[0]; | |
var thirdValue = myArray[2]; | |
console.log(firstValue, thirdValue); // 1 3 |
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
const myArray = ["one", "two", "three", "four", "five"]; | |
const [one, two, three] = myArray; | |
console.log(one); // "one" | |
console.log(two); // "two" | |
console.log(three); // "three" |
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 a; | |
let b; | |
[a, b] = [1, 2]; | |
console.log(a); // 1 | |
console.log(b); // 2 |
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 a; | |
let b; | |
let myArray = [1, 2, 3, 4, 5, 6]; | |
[a, b] = myArray; | |
console.log(a); // 1 | |
console.log(b); // 2 |
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 a = 1; | |
let b = 3; | |
[a, b] = [b, a]; | |
console.log(a); // 3 | |
console.log(b); // 1 |
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
const myObject = { | |
onePassion: 'JS', crazy: true | |
}; | |
const {onePassion, crazy} = myObject; | |
console.log(onePassion) // 'JS' | |
console.log(`Crazy people? ${crazy}`) // "Crazy people? true" |
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 {a=1, b=2} = {a: 3}; | |
console.log(a); // 3 | |
console.log(b); // 2 |
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
var ReactRouter = require('react-router'); | |
var Route = ReactRouter.Route; | |
var Link = ReactRouter.Link; | |
var Router = ReactRouter.Router; |
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
const { | |
Route, | |
Link, | |
Router | |
} = require('react-router'); |