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
Explain prototypal/differential inheritance?
What are global variables in javascript?
How do I add a javascript event handler to an html page element?
What is bom?
What is difference between deep and shallow object coping in javascript?
What is difference == and === in javascript?
What e means?
What does the isNaN() function?
What does "1"+2+3 evaluate to?
How to loop through array in javascript?
What is break and continue statements?
What is the default scope in javascript?
How to create an array in javascript?
How to use strings as array indexes using javascript?
How to replace all occurrences of a string in JavaScript?