And that's why you remind me
That I can never be lost in the sauce, I'm a boss
And everything was a lesson, from that loss, I gained it all
Clan: #100Devs - leonnoel.com/twitch
for (let i = 1; i < 5; i++) {
console.log(i)
}
let newArr = []
newArr = ['Zebra',true,21]
newArr = ['Zebra',,true,21]
console.log( newArr[0] ) //Zebra
console.log( newArr[1] ) //undefined
console.log( newArr[2] ) //true
console.log( newArr[3] ) //21
newArr = ['Zebra',,true,21]
newArr[1] = 'Bob'
console.log( newArr )
// ['Zebra','Bob',true,21]
console.log( newArr.length ) //4
let bestColors = ['green','blue','yellow','black']
bestColors.forEach((x,i)=> console.log(x))
let stopwatch = {}
stopwatch.currentTime = 12
stopwatch.tellTime = function(time){
console.log(`The current time is ${time}.`)
}
stopwatch.tellTime(stopwatch.currentTime)
fetch("https://dog.ceo/api/breeds/image/random")
.then(res => res.json()) // parse response as JSON
.then(data => {
console.log(data)
})
.catch(err => {
console.log(`error ${err}`)
});
fetch(url)
.then(res => res.json()) // parse response as JSON
.then(data => {
console.log(data)
})
.catch(err => {
console.log(`error ${err}`)
});
const url = 'https://www.thecocktaildb.com/api/json/v1/1/search.php?s=margarita'
localStorage.setItem('bestFriend', 'Bob')
localStorage.getItem('bestFriend', 'Bob')
localStorage.removeItem('bestFriend', 'Bob')
localStorage.clear()