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 four basic data structures in javascript?
how can we retrieve value from one database server and store them another database server using sql server code
Explain the difference between “==” and “===”?
Explain the working of timers in JavaScript? Also elucidate the drawbacks of using the timer, if any?
Is there an alternative to javascript?
Why does the browser display the slow script warning?
What is the use of debugger keyword in javascript?
What is the difference between ‘function declaration’ and ‘function expression’?
How about 3+5+"8"?
What is s+ in regex?
How do I get javascript?
Can you access Cookie using javascript?
What do I need to code javascript?
What is a name function in javascript?
What is event in javascript?