let programmingLanguages = ["JavaScript", "Python", "Java", "C#"]; console.log(programmingLanguages[-1]); console.log(programmingLanguages[100]); let javaScriptFrameworks = ["React", "Angular", "Ember"]; console.log(javaScriptFrameworks); // Set the value of index 2 to be "Vue" javaScriptFrameworks[2] = "Vue"; // Notice the value at index 2 is now "Vue" console.log(javaScriptFrameworks); let charles = ['coder', 'Tech', 47, 23, 350]; charles.sort(); console.log(charles); let groceryBag = ['bananas', 'apples', 'edamame', 'chips', 'cucumbers', 'milk', 'cheese']; let selectedItems = []; selectedItems = groceryBag.slice(2, 5).sort(); console.log(selectedItems); let shuttleCrews = [ ['Robert Gibson', 'Mark Lee', 'Mae Jemison'], ['Kent Rominger', 'Ellen Ochoa', 'Bernard Harris'], ['Eilen Collins', 'Winston Scott', 'Catherin Coleman'] ]; console.log(shuttleCrews[0][2]); console.log(shuttleCrews[1][1]); console.log(shuttleCrews[2][1]); let sshuttleCrews = [ ['Robert Gibson', 'Mark Lee', 'Mae Jemison'], ['Kent Rominger', 'Ellen Ochoa', 'Bernard Harris'], ['Eilen Collins', 'Winston Scott', 'Catherin Coleman'] ]; let newCrew = ['Mark Polansky', 'Robert Curbeam', 'Joan Higginbotham']; // Add a new crew array to the end of shuttleCrews sshuttleCrews.push(newCrew); console.log(sshuttleCrews[3][2]); // Reverse the order of the crew at index 1 sshuttleCrews[1].reverse(); console.log(sshuttleCrews[1]);
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter