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
What is "strict mode" and how is it used in JavaScript?
How can we establish connection with java and sql server?
What is a method in javascript?
What is the best ide for javascript development?
What is a function callback?
Can you explain the difference between call and apply?
How can you set position of the page (top and left) to 0 using javascript in one line code?
How do you write an if statement in javascript?
How do I enable cookies safari?
what is the difference between window & document in javascript?
What are all the looping structures in javascript?
How to test 404 page in QA
How do you declare javascript?
How to select an element by id and swapping an image?
How many types of data types are there?