array-ops

1.0.2 • Public • Published

array-ops

A comprehensive library for javascript array operations and manipulation.

Installation

npm install array-ops

Initilization

var arrayOps = require('array-ops')
var array = new array_ops()

Example

array.isArray([1,2,3])  // true

Methods

array.isArray(array)

Returns true if the passed value is an array.

array.isArray([1,2,3])              // true
array.isArray(1)                    // false

array.isNumericArray(array)

Returns true if all the elements of the array are numbers (Intergers or Decimal).

array.isNumericArray([1,2,3])       // true
array.isNumericArray([1,2,4.6])     // true
array.isNumericArray([1,'r',8)      // false

array.isIntegerArray(array)

Returns true if all the elements of the array are integers.

array.isIntegerArray([1,2,3])       // true
array.isIntegerArray([1,2,4.6])     // false

array.isDecimalArray(array)

Returns true if all the elements of the array are decimals.

array.isDecimalArray([24.3,82.6])   // true
array.isDecimalArray([1,2,3])       // false

array.isStringArray(array)

Returns true if all the elements of the array are strings.

array.isStringArray(['foo','bar'])  // true
array.isStringArray(['1','2','3'])  // true
array.isStringArray([1,34])         // false

array.isEmptyArray(array)

Returns true if the array is empty.

array.isStringArray([]) 			// true
array.isStringArray([1]) 			// false

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i array-ops

      Weekly Downloads

      0

      Version

      1.0.2

      License

      ISC

      Unpacked Size

      4.72 kB

      Total Files

      3

      Last publish

      Collaborators

      • akshay34