Secret Message array exercise

PHOTO EMBED

Thu Jul 14 2022 20:50:40 GMT+0000 (Coordinated Universal Time)

Saved by @cruz #javascript

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'];

secretMessage.pop();
//console.log(secretMessage.length);

secretMessage.push('to','Program');
//console.log(secretMessage);

secretMessage[7]= 'right';
//console.log(secretMessage);

secretMessage.shift();
//console.log(secretMessage);

secretMessage.unshift('Programming');
//console.log(secretMessage);

secretMessage.splice(6,5,'know');
 //console.log(secretMessage);
 ///.splice it used to select and replace. the 6 is the index and 5 is counting how much you want to replace and 'know' is what you are replacing it with.

console.log(secretMessage.join(' '));
// .join converts the array to a string, and the ' ' is to add spaces to the string so it reads like a normal sentence.
content_copyCOPY

https://www.youtube.com/watch?v=vG6ayBb2iIc&ab_channel=Codecademy