Description:
Javascript array unshift() method adds one or more elements to the beginning of an array and returns the new length of the array.
Syntax:
array.unshift( element1, ..., elementN );
Here is the detail of parameters:
element1, ..., elementN : The elements to add to the front of the array.
Return Value:
Returns the length of the new array. This returns undefined in IE browser.
Example:
<html>
<head>
<title>JavaScript...
SVN, iOS, VB.Net, JAVA, PHP, Python, Ruby, Perl, HTML, CSS, Javascript, MySQL, C++, UNIX,Tutorial, Examples,
Javascript Array toString() Method
4/7/14
Description:
Javascript array toString() method returns a string representing the source code of the specified array and its elements.
Syntax:
array.toString();
Here is the detail of parameters:
NA
Return Value:
Returns a string representing the array.
Example:
<html>
<head>
<title>JavaScript Array toString Method</title>
</head>
<body>
<script type="text/javascript">
var...
Javascript Array splice() Method
4/7/14
Description:
Javascript array splice() method changes the content of an array, adding new elements while removing old elements.
Syntax:
array.splice(index, howMany, [element1][, ..., elementN]);
Here is the detail of parameters:
index : Index at which to start changing the array.
howMany : An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed.
element1,...
Javascript Array sort() Method
4/7/14
Description:
Javascript array sort() method sorts the elements of an array.
Syntax:
array.sort( compareFunction );
Here is the detail of parameters:
compareFunction : Specifies a function that defines the sort order. If omitted, the array is sorted lexicographically.
Return Value:
Returns a sorted array.
Example:
<html>
<head>
<title>JavaScript Array sort Method</title>
</head>
<body>
<script...
Javascript Array toSource() Method
4/7/14
Description:
Javascript array toSource() method returns a string representing the source code of the array. This method is supported by Mozilla.
Syntax:
array.toSource();
Here is the detail of parameters:
NA
Return Value:
Returns a string representing the source code of the array.
Example:
<html>
<head>
<title>JavaScript Array toSource Method</title>
</head>
<body>
<script...
Javascript Array some() Method
4/7/14
Description:
Javascript array some() method tests whether some element in the array passes the test implemented by the provided function.
Syntax:
array.some(callback[, thisObject]);
Here is the detail of parameters:
callback : Function to test for each element.
thisObject : Object to use as this when executing callback.
Return Value:
If some element pass the test then it returns true otherwise...
Javascript Array slice() Method
4/7/14
Description:
Javascript array slice() method extracts a section of an array and returns a new array.
Syntax:
array.slice( begin [,end] );
Here is the detail of parameters:
begin : Zero-based index at which to begin extraction. As a negative index, start indicates an offset from the end of the sequence.
end : Zero-based index at which to end extraction.
Return Value:
Returns the extracted array...
Javascript Array shift() Method
4/7/14
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 =...
Javascript Array reverse() Method
4/7/14
Description:
Javascript array reverse() method reverses the element of an array. The first array element becomes the last and the last becomes the first.
Syntax:
array.reverse();
Here is the detail of parameters:
NA
Return Value:
Returns the reversed single value of the array.
Example:
<html>
<head>
<title>JavaScript Array reverse Method</title>
</head>
<body>
<script...
Javascript Array reduce() Method
4/7/14
Description:
Javascript array reduce() method applies a function simultaneously against two values of the array (from left-to-right) as to reduce it to a single value.
Syntax:
array.reduce(callback[, initialValue]);
Here is the detail of parameters:
callback : Function to execute on each value in the array.
initialValue : Object to use as the first argument to the first call of the callback.
Return...
Javascript Array push() Method
4/7/14
Description:
Javascript array push() method appends the given element(s) in the last of the array and returns the length of the new array.
Syntax:
array.push(element1, ..., elementN);
Here is the detail of parameters:
element1, ..., elementN: The elements to add to the end of the array.
Return Value:
Returns the length of the new array.
Example:
<html>
<head>
<title>JavaScript...
Javascript Array pop() Method
4/7/14
Description:
Javascript array pop() method removes the last element from an array and returns that element.
Syntax:
array.pop();
Here is the detail of parameters:
NA
Return Value:
Returns the removed element from the array.
Example:
<html>
<head>
<title>JavaScript Array pop Method</title>
</head>
<body>
<script type="text/javascript">
var numbers = [1, 4, 9];
var...
Javascript Array map() Method
4/7/14
Description:
Javascript array map() method creates a new array with the results of calling a provided function on every element in this array.
Syntax:
array.map(callback[, thisObject]);
Here is the detail of parameters:
callback : Function that produces an element of the new Array from an element of the current one.
thisObject : Object to use as this when executing callback.
Return Value:
Returns...
Javascript Array lastIndexOf() Method
4/7/14
Description:
Javascript array lastIndexOf() method returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting atfromIndex.
Syntax:
array.lastIndexOf(searchElement[, fromIndex]);
Here is the detail of parameters:
searchElement : Element to locate in the array.
fromIndex : The index at which to start searching backwards....
Javascript Array join() Method
4/7/14
Description:
Javascript array join() method joins all elements of an array into a string.
Syntax:
array.join(separator);
Here is the detail of parameters:
separator : Specifies a string to separate each element of the array. If omitted, the array elements are separated with a comma.
Return Value:
Returns a string after joining all the array elements.
Example:
<html>
<head>
<title>JavaScript...
Javascript Array indexOf() Method
4/7/14
Description:
Javascript array indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.
Syntax:
array.indexOf(searchElement[, fromIndex]);
Here is the detail of parameters:
searchElement : Element to locate in the array.
fromIndex : The index at which to begin the search. Defaults to 0, i.e. the whole array will be searched. If the...
Javascript Array forEach() Method
4/7/14
Description:
Javascript array forEach() method calls a function for each element in the array.
Syntax:
array.forEach(callback[, thisObject]);
Here is the detail of parameters:
callback : Function to test each element of the array.
thisObject : Object to use as this when executing callback.
Return Value:
Returns created array.
Compatibility:
This method is a JavaScript extension to the ECMA-262...
Javascript Array filter() Method
4/7/14
Description:
Javascript array filter() method creates a new array with all elements that pass the test implemented by the provided function.
Syntax:
array.filter(callback[, thisObject]);
Here is the detail of parameters:
callback : Function to test each element of the array.
thisObject : Object to use as this when executing callback.
Return Value:
Returns created array.
Compatibility:
This...
Javascript Array every Method
4/7/14
Description:
Javascript array every method tests whether all elements in the array pass the test implemented by the provided function.
Syntax:
array.every(callback[, thisObject]);
Here is the detail of parameters:
callback : Function to test for each element.
thisObject : Object to use as this when executing callback.
Return Value:
Returns true if every element in this array satisfies the provided...
Javascript Array concat() Method
4/7/14
Description:
Javascript array concat() method returns a new array comprised of this array joined with two or more arrays.
Syntax:
array.concat(value1, value2, ..., valueN);
Here is the detail of parameters:
valueN : Arrays and/or values to concatenate to the resulting array.
Return Value:
Returns the length of the array.
Example:
<html>
<head>
<title>JavaScript Array concat Method</title>
</head>
<body>
<script...
Javascript String - sup() Method
4/7/14
Description:
This method causes a string to be displayed as a superscript, as if it were in a <sup> tag.
Syntax:
string.sup( )
Here is the detail of parameters:
NA
Return Value:
Returns the string with <sup> tag.
Example:
<html>
<head>
<title>JavaScript String sup() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String("Hello...
Javascript String - sub() Method
4/7/14
Description:
This method causes a string to be displayed as a subscript, as if it were in a <sub> tag.
Syntax:
string.sub( )
Here is the detail of parameters:
NA
Return Value:
Returns the string with <sub> tag.
Example:
<html>
<head>
<title>JavaScript String sub() Method</title>
</head>
<body>
<script type="text/javascript">
var str = new String("Hello...
Subscribe to:
Posts (Atom)
Related Posts
-
If you want to list down your website, book or any other resource on this page then please contact at webmaster@tutorialspoint.com CSS 1...
-
This is a complete reference guide for web developers where haved we listed all the CSS properties defined in the World Wide Web Consortium...
-
If you think this PDF is worth of $5.99 value, kindly pay this little amount using a Credit Card or PayPal for the PDF. Download CSS Tu...
-
Description: This method creates an HTML anchor that is used as a hypertext target. Syntax: string .anchor( anchorname ) Here is ...
-
Description: This method returns a number indicating whether a reference string comes before or after or is the same as the given string ...
-
Description: Javascript array unshift() method adds one or more elements to the beginning of an array and returns the new length of the...
-
Description: This method converts a number object, into a human readable string representing the number using the locale of the environ...
-
Description: Javascript boolean valueOf() method returns the primitive value of the specified boolean object.. Syntax: boolean .va...
-
Description: This method returns the index within the calling String object of the last occurrence of the specified value, starting the s...
-
Description: Javascript array toString() method returns a string representing the source code of the specified array and its elements. ...