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 is the use of the ‘this’ keyword?
What is null in js?
How do you check if an object is an array or not?
In a pop-up browser window, how do you refer to the main browser window that opened it?
Which javascript is best?
What is console.time() and console.timeend()? What is its syntax, and why is it used?
What are the Advantages and Disadvantages of JavaScript?
What do you mean by enumeration?
How to create a function in javascript?
What is data types in javascript?
Why is var better than let?
Can you explain about screen object?
What is the difference between "var" and "let" keywords?
Where should I put script tags?
I need project details about WEB CONTENT FILTERING USING NEURAL NETWORKS and how to explain it....plz help me in this topic.....