- Print blue and 1996 to the screen using object destructuring
const car = {
colour: 'blue',
brand: 'ford',
gears: 4,
year: '1996',
// Mr. Scrooge has a sum of money 'P' that wants to invest, and he wants to know how many years 'Y' this sum has to be kept in the bank in order for this sum of money to amount to 'D'. | |
// The sum is kept for 'Y' years in the bank where interest 'I' is paid yearly, and the new sum is re-invested yearly after paying tax 'T' | |
// Note that the principal is not taxed but only the year's accrued interest | |
// Example: | |
// Let P be the Principal = 1000.00 | |
// Let I be the Interest Rate = 0.05 |
// You are given an array strarr of strings and an integer k. Your task is to return the first longest string consisting of k consecutive strings taken in the array. | |
// #Example: longest_consec(["zone", "abigail", "theta", "form", "libe", "zas"], 2) | |
// => "abigailtheta" | |
// n being the length of the string array, if n = 0 or k > n or k <= 0 return "" | |
function longestConsec(strarr, k) { | |
if (k <= 0 || strarr.length <= 0 || k > strarr.length) { | |
return "" |
// 1 | |
const car = { | |
colour: 'blue', | |
brand: 'ford', | |
gears: 4, | |
year: '1996', | |
manual: true | |
} | |
const { colour, year } = car |
Think of an API as something that's part of a remote server (where code is deployed) that receives requests and sends back responses 🔙.
function Car(brand, colour, year) { | |
this.brand = brand | |
this.colour = colour | |
this.year = year | |
this.printCar = function() { | |
console.log(`this cars brand is ${this.brand} and it was made in ${this.year}`) | |
} | |
} | |
const ford = new Car('ford', 'blue', 1993) |
* { | |
margin: 0; | |
} | |
.pokemon-list { | |
display: flex; | |
flex-flow: row wrap; | |
justify-content: center; | |
} |
get '/todolist' | |
db.tasks.find({}) | |
get '/todolist/:id' | |
db.tasks.find({_id: id}) | |
get '/search' | |
db.tasks.find({name: name}) | |
post '/todolist' |
[ | |
{ | |
"name":"Bulbasaur", | |
"attack":49, | |
"defense":49, | |
"evolveLevel":16, | |
"evolveTo":"2", | |
"type":"grass", | |
"moves":[ | |
"tackle", |