-1

I have two arrays as following.

var first = [['2','23','33'],['2','23','33'],['2','23','33']]

var second = ['value1','value2','value3']

Now i want to push second array into first like this.

var first = [['value1','value2','value3'],['2','23','33'],['2','23','33'],['2','23','33']]

Thanks in advance

0

1 Answer 1

0

Use unshift to adds element to the beginning of an array

var first = [['2','23','33'],['2','23','33'],['2','23','33']]

var second = ['value1','value2','value3']
first.unshift(second)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.