class-array-object
v1.1.3
Published
class array object.
Downloads
26
Maintainers
Readme
class-array-object
类数组对象
usage
import ArrayObject from 'class-array-object'
//or
//const ArrayObject = require('class-array-object')
let ao = new ArrayObject() //{length: 0}
let ao = new ArrayObject({a: 1, b: 2}) //{a: 1, b: 2, length: 2}
let ao = new ArrayObject(1, 'b') //{1: undefined, b: undefined, length: 2}
let ao = new ArrayObject([1, 'b']) //{1: undefined, b: undefined, length: 2}
let ao = new ArrayObject({a: 1}, 2, [1, 'b'], 5) //{a: 1, 1: undefined, 2: undefined, 5: undefined, b: undefined, length: 5}
//add
ao.add(c, '78')
//remove
ao.remove(c)
//map
ao.map((key, val) => {
//
})