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 |
Where do I put javascript code in html?
Is there any class in javascript?
Hi all, I got a job in Bangalore even though it's recession time. They have said my project will involve Java, Ruby on Rails, Ajax and they also said Web Services (which i have always wanted to try) and some stuff I have not much exposure like REST, mashups and Struts. Can anyone tell me if there are some good training or conferences to get to speed with these technologies. I need to do really good in my job. Thanks, Vaibhavi
Where can I learn javascript for free?
How are tag positions used in javascript?
Is there any ide for javascript?
Explain the role of deferred scripts in javascript?
How to encode and decode a url in javascript?
What can be the challenges during testing a program or a system?
Why is javascript not oop?
How is a relation not a function?
Explain how to write class methods vs. Instance methods.