-
-
Save codecademydev/bdacff6a53af6d712731889880157edb to your computer and use it in GitHub Desktop.
Codecademy export
This file contains 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
let secretMessage = ['Learning', 'is', 'not', 'about', 'what', 'you', 'get', 'easily', 'the', 'first', 'time,', 'it', 'is', 'about', 'what', 'you', 'can', 'figure', 'out.', '-2015,', 'Chris', 'Pine,', 'Learn', 'JavaScript']; | |
//console.log(secretMessage.length); prints 24 | |
// | |
let last = secretMessage.pop(); | |
//console.log(secretMessage.length); prints 23 | |
//Exercise 1 2 | |
// | |
let addString = secretMessage.push('to', 'Program'); | |
//console.log(secretMessage.length); prints 25 | |
//Exercise 3 | |
// | |
let removed = secretMessage.splice(7, 1, 'rigth'); | |
//secretMessage.forEach(function(item, index, array) {console.log(item, index)}); //prints easily [7] | |
//secretMessage.forEach(function(item, index, array) {console.log(item, index)}); // prints rigth [7] | |
//Exercise 4 | |
// | |
let removed1st = secretMessage.shift(); | |
//console.log(secretMessage);// Removes 'Learning' | |
//Exercise 5 | |
// | |
let addNewString = secretMessage.unshift('Programming'); | |
//console.log(secretMessage);// Prints 'Programming...' | |
//Exercise 6 | |
// | |
let newMessage = secretMessage.splice(6, 11,'know,'); | |
//Exercise 7 | |
// | |
console.log(secretMessage.join(' ')); | |
// Prints "Programming is not about what you know, figure out. -2015, Chris Pine, Learn to Program"// | |
//Exercise 8// | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment