From the array of given trash, make sure every item goes into the right bin. If an item happens to be dirty, it should go to the generic bin, regardless of material.
Here is the array of trash:
From a two dimensional array (with the same height and width), extract and concat all the elements from the "first diagonal", starting from the top left corner to the bottom right corner.
function concatFirstDiagonal(twoDimArray) {
// your code goes here
const myRover = { | |
// position is an array of 2 elements -> first element is x and the second element is y | |
position: [0,0], | |
direction: 'N', | |
roverDirections: ['N', 'E', 'S', 'W'], | |
theCommands: ['f', 'b', 'l', 'r'] | |
}; | |
const theCommands = prompt ("Insert the instruction: "); |
class Chronometer { | |
constructor() { | |
this.currentTime = 0; | |
this.intervalId = 0; | |
} | |
startClick() { | |
this.intervalId = setInterval(() => this.currentTime++, 1000); | |
} |
Use destructuring assignment with the rest operator to perform an effective Array.prototype.slice()
so that arr is a sub-array of the original array source with the first two elements omitted.
const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {
// your code goes here
}
const arr = removeFirstTwo(source);
const source = [1,2,3,4,5,6,7,8,9,10]; | |
function removeFirstTwo(list) { | |
// change code below this line | |
const [a,b,...arr] =list // change this | |
// change code above this line | |
return arr; | |
} | |
const arr = removeFirstTwo(source); |
const usersArray = [ | |
{ | |
firstName: 'Kirby', | |
lastName: 'Doyle', | |
id: 'b71794e5-851e-44b5-9eec-1dd4e897e3b8', | |
isActive: false, | |
balance: '$3,570.06', | |
gender: 'male' | |
}, | |
{ |
NoSQL DB is a database used to manage huge sets of unstructured data, where the data is not stored in tabular relations like relational databases.
Following are the NoSQL database types: