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 the different functional component in javascript?
What will be the output of the following statements?
What is the use of a weakmap object in javascript?
How do I use javascript to password-protect my web site?
What is a module in javascript?
Explain function hoisting in javascript?
How to convert json object to string?
Why global variables are bad javascript?
What is called variable typing in javascript?
How many days it will take to learn javascript?
Explain the role of deferred scripts in javascript?
What is javascript and its advantages?
How do you create array in javascript?
What is Unobtrusive JavaScript & Why it's Important?
How to access an external javascript file that is stored externally and not embedded?