| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

Array

Page history last edited by PBworks 17 years, 12 months ago


 

Array

Note that Array is a builtin JavaScript object.

The methods listed below are merely prototype extensions to it.


Object Summary

 

Prototype add-ons to the builtin Array object.

Currently, only basic methods are included in it.

We're planning to make new additions to the object in latter releases.

Note that the methods of Array below are supported by all modern browsers. So we did not include wrappers for them.

 

  • .concat()
  • .pop()
  • .push()
  • .shift()
  • .slice()]
  • .splice(
  • .unshift()

Methods

 

Array.indexOf(elm)

 

parameters

elm - The element to seek its index.

 

returns

The first occurrence of elm, -1 if there is no match.

 

comments

Returns the index of the first occurrence of elm in the array.


Array.contains(elm)

 

parameters

elm - The element to check.

 

returns

true if the array contains elm, false otherwise.

 

comments

Checks whether or not the Array contains elm.


Array.copy()

 

returns

A copy of the original array.

 

comments

Copies the contents of an array and returns it.

 

If any element of the array is copyable (i.e. it is an Array or

has a copy method available) those elements are copied as well.

 

Otherwise primitive members (strings,numbers) ar copied but

objects (functions,associative arrays,vendor-specific objects etc.)

are passed by ref.


Array.clear()

 

comments

Removes all the contents of the Array. The new length of the Array becomes zero.


Array.first()

 

returns

The first element of the Array.

 

comments

Gets the first element.


Array.last()

 

returns

The last element of the Array.

 

comments

Gets the last element.


See Also

 

EventRegistry

Preloader


Usage Examples

 

Comments (0)

You don't have permission to comment on this page.