Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript prepend string to array

const names = ["Bob", "Cassandra"]

names.unshift("Alex")

names === ["Alex", "Bob", "Cassandra"]
 
PREVIOUS NEXT
Tagged: #javascript #prepend #string #array
ADD COMMENT
Topic
Name
7+1 =