What is a way to append a value to an array?
Answers were Sorted based on User's Feedback
Answer / narasimhan
We can use push() method to add an element in an array in
its last node.
| Is This Answer Correct ? | 25 Yes | 3 No |
Answer / 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 |
Answer / gayathri
its a way to append a value to an array
arr[arr.length] = value;
| Is This Answer Correct ? | 4 Yes | 7 No |
Answer / shailendra shukla
String AnswerArray[];
AnswerArray=new String[50];
Int Index=1;
AnswerArray[Index]=Test;
| Is This Answer Correct ? | 5 Yes | 11 No |
Why javascript is called as script for all browsers?
java pgm for compare two vesion and print the greatest version on the console. e.g: like 1.4.2 and 1.5.2 biggest is 1.5.2 1.2.5 and 1.2.8 biggest is 1.2.8
Which built-in method sorts the elements of an array?
How to set the focus in an element using javascript?
Is javascript client side or server side?
How do I use javascript to password-protect my web site?
How to toggle display an html element?
What is new function in javascript?
Write the code to maximize an image using javaScript?
What boolean operators can be used in JavaScript?
What is the use of anonymous function in javascript?
What is object in javascript?