Pages

Javascript Array shift() Method

Description:

Javascript array shift() method removes the first element from an array and returns that element.

Syntax:

array.shift();
Here is the detail of parameters:
  • NA

Return Value:

Returns the removed single value of the array.

Example:

<html>
<head>
<title>JavaScript Array shift Method</title>
</head>
<body>
<script type="text/javascript">
var element = [105, 1, 2, 3].shift();
document.write("Removed element is : " + element ); 
</script>
</body>
</html>
This will produce following result:
Removed element is : 105 
 
 
+JavaScript +JavaScript Frameworks Links +Javascript Development 
+JavaScript's and More, Software and Marketing +JavascriptU +JavaScriptOn 
+Javascript Problems +JavaScriptOn 
 +javaScript is a creek in West Virginia in the summe   
 
 

No comments:

Flag Counter
| Copyright © 2013 Remote Tutor