API Docs for:
Show:

List Class

Defined in: simple.mvc.js:48
Module: MVC

List

A more human way of handling array's in JavaScript. It provides some extra methods for manipulating an array, which makes it more easy and semantic such as when e.g. adding and removing elements using .Add() and .Remove().

Methods

Add

(
  • An
)
Array

Add

Add a new element - It's more semantic to use .Add() instead of .push().

Parameters:

  • An Object

    element.

Returns:

Array:

The array.

Add

(
  • An
)
Array

Defined in simple.mvc.js:86

Add

Add a new element - It's more semantic to use .Add() instead of .push().

Parameters:

  • An Object

    element.

Returns:

Array:

The array.

Clear

()

Defined in simple.mvc.js:180

Clear

Remove all the elements from the array.

Clear

()

Clear

Remove all the elements from the array.

Contains

(
  • An
)

Defined in simple.mvc.js:168

Contains

Check if the specified element is in the list

Parameters:

  • An Object

    element.

Contains

(
  • An
)

Contains

Check if the specified element is in the list

Parameters:

  • An Object

    element.

Get

(
  • A
)
Object

Get

Get an element from the array.

Parameters:

  • A Integer

    key.

Returns:

Object:

An object from the array.

Get

(
  • A
)
Object

Defined in simple.mvc.js:100

Get

Get an element from the array.

Parameters:

  • A Integer

    key.

Returns:

Object:

An object from the array.

GetById

(
  • A
  • A
)
Object

Find

Find an element in the array. Returns null, if nothing is found.

Parameters:

  • A Object

    key.

  • A Object

    value to search for.

Returns:

Object:

An object from the array.

GetById

(
  • A
  • A
)
Object

Defined in simple.mvc.js:113

Find

Find an element in the array. Returns null, if nothing is found.

Parameters:

  • A Object

    key.

  • A Object

    value to search for.

Returns:

Object:

An object from the array.

KeyCheck

(
  • e
  • n
)

KeyCheck

A friendly way to check which key was used.

Parameters:

  • e Object

    Event

  • n String

    Name of the key to check against (e.g. 'enter', 'escape')

KeyCheck

(
  • e
  • n
)

Defined in simple.mvc.js:31

KeyCheck

A friendly way to check which key was used.

Parameters:

  • e Object

    Event

  • n String

    Name of the key to check against (e.g. 'enter', 'escape')

Remove

(
  • An
)

Defined in simple.mvc.js:134

Remove

Remove an element (if found) from the array.

Parameters:

  • An Object

    element.

Remove

(
  • An
)

Remove

Remove an element (if found) from the array.

Parameters:

  • An Object

    element.

RemoveAt

(
  • Index.
)

RemoveAt

Remove an element at index (if found) from the array.

Parameters:

  • Index. Integer

RemoveAt

(
  • Index.
)

Defined in simple.mvc.js:156

RemoveAt

Remove an element at index (if found) from the array.

Parameters:

  • Index. Integer