Question:Briefly describe JavaScript core Array method push() with an example. 

Answer Array.push() method add a value to the end of the array (top of the stack) and leaves it there.Example:
var stackWork=new Array("Lenny","Harold","Mary","Jean","Sal");
  stackWork.push("Delia");
  document.write(stackWork);
Output: Lenny,Harold,Mary,Jean,Sal,Delia 

+ Report
Total Preview: 1038
Briefly describe JavaScript core Array method push() with an example.
Copyright © 2024. Powered by Intellect Software Ltd