JavaScript

A5.u.array.objectfrom Method

Syntax

A5.u.array.object.from(properties,data)

Arguments

propertiesarray

The array of property names to use from the object.

dataobject

The object to be converted.

Returns

arrayarray

The resulting array.

Description

Convert an object into an array.

Discussion

The A5.u.array.object.from method can convert an object into an array. The array will have the objects values output in the order the properties are listed. Missing values will be output as null.

Example

var res = A5.u.array.object.from(['a','b','c'],{b: 'hello', c: 'world'});
// res = [null, 'hello', 'world']