Skip to content

Instantly share code, notes, and snippets.

View sandrabosk's full-sized avatar
👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall

Aleksandra Bošković sandrabosk

👩‍💻
Always a student, never a master. Have to keep moving forward. ~C.Hall
  • Ironhack
View GitHub Profile
// ************************************************
// ****************** 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:
const data = {
name: {
firstName: 'ana',
lastName: 'marino',
},
isStudent: true,
favoriteFootballTeam: 'fc barcelona',
hometown: {
city: 'buenos aires',
country: 'argentina',
// 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',
// 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,
@sandrabosk
sandrabosk / canvas-animations-2.html
Last active February 10, 2022 22:42
canvas animations - setTimeout
<!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>
@sandrabosk
sandrabosk / index.js
Last active April 27, 2020 19:15
solution-canvas-animation
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;
<!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>
@sandrabosk
sandrabosk / canvas-animations.html
Last active April 28, 2020 03:04
canvas animations - requestAnimationFrame
<!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>
<!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>

Canvas | Animation steps