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 the most popular javascript library?
How to get inner html of an element in javascript?
Is everything in javascript asynchronous?
How to modify the url of the page without reloading the page?
What is dhtml in javascript?
What is the difference between call & apply?
What is the difference between test () and exec () methods?
What does trim stand for?
How to delete an array entry using javascript?
Why is javascript so hard?
How to you change the title of the page by javascript?
What does the enableviewstatemac setting in an aspx page do?
What is the default data type in javascript?
How can javascript be used to improve the "look and feel" of a web site? By the same token, how can javascript be used to improve the user interface?
What is the difference between the operators ‘==‘ & ‘===‘?