# Group

An extended Map with extra methods

# Constructor

new Group();

# Methods

# every(function, arg)

Checks if all items passes the function, equals to Array.every()

PARAMETER TYPE DESCRIPTION OPTIONAL
function Function The function to test each item No
thisArg Any Value to use as this in the function No

# filter(fn)

Find values an gets a group with found items, equals to Array.filter()

PARAMETER TYPE DESCRIPTION OPTIONAL
fn Function The function to evaluate No

# find(fn)

Find values an gets the first found result, equals to Array.find()

PARAMETER TYPE DESCRIPTION OPTIONAL
fn Function The function to evaluate No
  • Return: Any

# first(count)

Obtanis the first item(s) of the group

PARAMETER TYPE DESCRIPTION OPTIONAL
count Number The amount of items Yes

# get(query)

Gets a value from the group by its key, literally Map.get()

PARAMETER TYPE DESCRIPTION OPTIONAL
query String The key No
  • Return: Any

# has(query)

Check if a key exist in the group, literally Map.has()

PARAMETER TYPE DESCRIPTION OPTIONAL
query String The key No

# last(count)

Obtanis the last item(s) of the group

PARAMETER TYPE DESCRIPTION OPTIONAL
count Number The amount of items Yes

# map(fn, thisArg)

Creates a new array with results of given function in each item, equals to Array.map()

PARAMETER TYPE DESCRIPTION OPTIONAL
function Function The function to test each item No
thisArg Any Value to use as this in the function No

# some(function, arg)

Checks if at least one item passes the function, equals to Array.some()

PARAMETER TYPE DESCRIPTION OPTIONAL
function Function The function to test each item No
thisArg Any Value to use as this in the function No

# toArray()

Generate an array of values of this group