Created
July 10, 2020 15:14
-
-
Save sandrabosk/ba2ebf12910b3b42bd2d96591005b492 to your computer and use it in GitHub Desktop.
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
// Use the given array and perform following operations on it: | |
const favorites = ['javascript', 'html', 'css']; | |
// remove first element | |
// ... your code here | |
console.log(favorites); // => [ 'html', 'css' ] | |
// remove last element | |
// ... your code here | |
console.log(favorites); // => [ 'html' ] | |
// add 'react' on the first place | |
// ... your code here | |
console.log(favorites); // => [ 'react', 'html' ] | |
// add 'node' to the last place | |
// ... your code here | |
console.log(favorites); // => [ 'react', 'html', 'node' ] | |
// remove element in the position 2 and add 'express' | |
// ... your code here | |
console.log(favorites); // => [ 'react', 'express', 'node' ] | |
// remove elements in the positions 2 and 3 and add 'mongodb' | |
// ... your code here | |
console.log(favorites); // => [ 'react', 'mongodb' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment