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 difference between undefined variable and undeclared variable?
How do you target a specific frame from a hyperlink?
Which companies are using node js?
Can I write javascript in notepad?
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?
How to get complete current page url with javascript?
Define unescape() function?
What is difference between scripting and programming?
What are global variables in javascript?
How to use one javascript function for multiple input fields?
How do I run javascript on my iphone?
What is variable typing?
How to capture the Image width and height using QTP script ? Kindly answer plz.... Thanx in adavance...
Is a parabola a function?
How do functions work in javascript?