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
// ************************************************ | |
// ****************** Arrays ********************* | |
// ************************************************ | |
const campuses = ['madrid', 'barcelona', 'miami']; | |
const [firstCampus, secondCampus, thirdCampus] = campuses; | |
console.log(thirdCampus); // miami | |
// Put the first item in the array in a variable: |
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 data = { | |
name: { | |
firstName: 'ana', | |
lastName: 'marino', | |
}, | |
isStudent: true, | |
favoriteFootballTeam: 'fc barcelona', | |
hometown: { | |
city: 'buenos aires', | |
country: 'argentina', |
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
// Given the object 'data', use the object destructuring to be able | |
// to print student first and last name, favorite football club, | |
// as well as the city and the country this student is coming from. | |
// BONUS: Write a function to capitalize all the words that need to be capitalized. | |
const data = { | |
name: { | |
firstName: 'ana', | |
lastName: 'marino', |
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
// Since the same variable names are used throughout the document (since we work on one object), | |
// you will have to comment out previous when demo the next. | |
// ************************************************ | |
// ****************** Objects ********************* | |
// ************************************************ | |
let person1 = { | |
name: 'Ironhacker', | |
age: 25, |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Canvas Animations</title> | |
</head> | |
<body> |
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 canvas = document.querySelector('#canvas'); | |
const ctx = canvas.getContext('2d'); | |
const cWidth = canvas.width; | |
const cHeight = canvas.height; | |
let speed1 = 300; | |
let speed2 = 300; | |
let speed3 = 300; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Canvas Animations</title> | |
</head> | |
<body> | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Canvas Animations</title> | |
</head> | |
<body> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge" /> | |
<title>Canvas State</title> | |
</head> | |
<body> |