Arrays use numbers to access its "elements". unshift(value) → Add an element to the beginning of an array. I love your work, I love your way of coding, precise, concise, really neat. This is done by using the JavaScript native methods .parse()and .stringify() We want to do this following: Parse the JSON object to create a native JavaScript Object; Push new array element into the object using .push() Use stringify() to convert it back to its original format. Have the marquee effect without using the tag (with CSS, JavaScript and jQuery). The first and probably the most common JavaScript array method you will encounter is push(). All right, let us now get into the ways to append elements to an array. But this will result in a string with the “flattened array” instead. Improve this sample solution and post your code through Disqus Previous: Write a JavaScript program to compute the sum and product of an array of integers. Let us walk through more examples, read on to find out! You’re great. Adding arrays in JavaScript is nothing but the appending arrays, which is generally called as JavaScript array append. Code:

You can click the button to add a new subject mathematics in the subjects array.