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 |
<script type="text/javascript"> function dispValue(e) { v = function (s) { return e.name + ': ' + s } if (e.type == "") return v(e.checked ? "" : ""); else return v(e.value); }
What is event bubbling in the dom?
What is the use of 'bind' method in JavaScript?
How to create scale in P info
Write a main method that prompts the user to enter the starting population, birth and death rates, and the number of years. The input birth and death rates cannot be negative, the starting population cannot be less than 2, and the number of years greater than 0. If the user enters an invalid value, this program will prompt user to re-enter the value until a valid value has been read. When all input values are valid, call on the methods above to compute estimated population and print result.
What is a nan value?
List out the different ways an HTML element can be accessed in a Javascript code?
What are the uses of javascript in web page designing?
What is the difference between null and undefined?
What are the benefits of learning javascript?
What is event in javascript?
How to call a function in every x seconds in javascript?