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 are global variables in javascript?
Explain what is pop()method in JavaScript?
What is a nan value?
How are DOM utilized in JavaScript?
What is closure? Give an example.
What is the difference between local storage & session storage?
Explain spread operator in javascript?
What is let keyword in typescript?
What is double exclamation point?
What is question mark in javascript?
What is the use of ‘debugger’ keyword in javascript code?
How to modify the url of the page without reloading the page?
What is a good javascript editor?
Why javascript is so popular?
Write the code for adding new elements dynamically?