What is a way to append a value to an array?
Answer Posted / venkateswaran
We can append a value in a array using two methods
1.push() - add elements in end of the array
2.unshift() - add elements in begining of the array.
For example;
var arr = new Array(3);
arr[0] = "Venkat";
arr[1] = "Sathya";
arr.push("Meena")
| Is This Answer Correct ? | 23 Yes | 2 No |
Post New Answer View All Answers
Why is javascript so important?
Are Typescript and Javascript the same?
How to load another html page from javascript?
Which built-in method combines the text of two strings and returns a new string?
What is an onclick?
What is the difference between local storage & session storage?
Define escape() function?
What is s+ in regex?
What are the main features of javascript?
Do I need javascript enabled?
How to have the status line update when the mouse goes over a link (the support of the status line is sporadic)?
What is undefined in math?
How to disable an html object ?
Which built-in method adds one or more elements to the end of an array and returns the new length of the array?
What does double mean in javascript?