let numbers = [1, 2, 3, 4, 5]
console.log(numbers[0])
console.log(numbers[1])
console.log(numbers[2])
console.log(numbers[3])
console.log(numbers[4])
const goToWork= function(day){
if (day === 'Wednesday'){
return true;
}
else {
return false;
}
};
goToWork('Wednesday')
const goForRun = function(weather){
if (weather === 'Sunny'){
return true;
}
else {
return false;
}
};
goForRun('Sunny')
let myArray = ['Thomas', 'Amber', 'Raoul'];
let emptyArray = [];
for (let i = 0; i < myArray.length; i++) {
emptyArray.push( myArray[i] );
}
console.log(emptyArray, myArray);
“This” is the same as using “@“
class Person {
constructor(firstName, lastName){
this.firstName = firstName
this.lastName = lastName
}
greet() {
console.log(`Hello, I am ${this.firstName} ${this.lastName}`)
}
}
bob = new Person("Thomas", "Ochman")
bob.greet()