10.02.2018 Views

js_tutorial

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Javascript<br />

Syntax<br />

Its syntax is as follows:<br />

Array.pop();<br />

Return Value<br />

Returns the removed element from the array.<br />

Example<br />

Try the following example.<br />

<br />

<br />

JavaScript Array pop Method<br />

<br />

<br />

<br />

var numbers = [1, 4, 9];<br />

var element = numbers.pop();<br />

document.write("element is : " + element );<br />

var element = numbers.pop();<br />

document.write("element is : " + element );<br />

<br />

<br />

<br />

Output<br />

element is : 9<br />

element is : 4<br />

push ()<br />

Javascript array push() method appends the given element(s) in the last of the<br />

array and returns the length of the new array.<br />

Syntax<br />

201

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!