Created
October 16, 2020 18:52
-
-
Save jonathan-fielding/a8621c01c0e430ad9f59aafd82787525 to your computer and use it in GitHub Desktop.
Add an item to beginning of an array
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
const fruits = ["Banana", "Orange", "Apple", "Mango"]; | |
fruits.unshift("Kiwi"); | |
console.log(fruits); // ["Kiwi", "Banana", "Orange", "Apple", "Mango"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment