sfcode
An Online Competing and Development Environment
Array

Array instance

<tt>array/is</tt>

Confirms if given object is a native array

const isArray = require("type/array/is");
isArray([]); // true
isArray({}); // false
isArray("foo"); // false

<tt>array/ensure</tt>

If given argument is an array, it is returned back. Otherwise TypeError is thrown.

const ensureArray = require("type/array/ensure");
ensureArray(["foo"]); // ["foo"]
ensureArray("foo"); // Thrown TypeError: foo is not an array