Gazebo_simulation-Frontend/node_modules/make-array
Riddhi Dave f4870cd530 simulator page updates 2020-12-22 09:59:14 -05:00
..
test React files 2020-12-21 10:29:31 -05:00
.npmignore React files 2020-12-21 10:29:31 -05:00
.travis.yml React files 2020-12-21 10:29:31 -05:00
LICENSE-MIT React files 2020-12-21 10:29:31 -05:00
Makefile React files 2020-12-21 10:29:31 -05:00
README.md React files 2020-12-21 10:29:31 -05:00
index.js React files 2020-12-21 10:29:31 -05:00
package.json simulator page updates 2020-12-22 09:59:14 -05:00
test.sh React files 2020-12-21 10:29:31 -05:00

README.md

make-array NPM version Build Status Dependency Status

Creates a real Array from almost anything.

Install

$ npm install make-array --save

Usage

var makeArray = require('make-array');
makeArray();              // []
makeArray(undefined);     // []
makeArray(1);             // [1]
makeArray([1, 2]);        // [1, 2]
makeArray({
  '0': 1,
  '1': 2,
  length: 2
});                       // [1, 2]

function foo (){
  return makeArray(arguments);
}

foo(1, 2, 3);             // [1, 2, 3]

makeArray(subject, [host])

  • subject mixed things you want to make it an array
  • host Array= if host is specified, the newly-created array will append to the end of the host

Returns Array. If host is specified, it will return the host itself.

var host = [1, 2];
function foo(){
  return arguments;
}

var result = makeArray(foo({}, []), host);
result;           // [1, 2, {}, []];
result === host;  // true

License

MIT