What is Pop() method in JavaScript?
Submitted by: Administrator► The pop() method is similar as the shift() method but the difference is that Shift method works at the end of the array.
► The pop() method take the last element off of the given array and returns it. The array on which is called is then altered.
► For example :
var fruits = ["apple ", "banana ", "mango"];
console.log(fruits.pop() );
console.log(fruits);
► We get the following console output :
mango
["apple ", "banana "];
Submitted by:
► The pop() method take the last element off of the given array and returns it. The array on which is called is then altered.
► For example :
var fruits = ["apple ", "banana ", "mango"];
console.log(fruits.pop() );
console.log(fruits);
► We get the following console output :
mango
["apple ", "banana "];
Submitted by:
Read Online Expert Developer JavaScript Job Interview Questions And Answers
Top Expert Developer JavaScript Questions
☺ | Mention what is the disadvantage of using innerHTML in JavaScript? |
☺ | Which keyword is used to print the text in the screen? |
☺ | Why it is not advised to use innerHTML in JavaScript? |
☺ | Explain the concept of unobtrusive JavaScript? |
☺ | How are JavaScript and ECMA Script related? |
Top Scripting language Categories
☺ | AngularJS Interview Questions. |
☺ | Ext-JS Interview Questions. |
☺ | Dojo Interview Questions. |
☺ | Expert Developer JavaScript Interview Questions. |
☺ | SWFObject Interview Questions. |