Irina Glushko 2389e7160b HW1 done | 3 éve | |
---|---|---|
.. | ||
index.d.ts | 3 éve | |
index.js | 3 éve | |
license | 3 éve | |
package.json | 3 éve | |
readme.md | 3 éve |
Convert a value to an array
$ npm install arrify
const arrify = require('arrify');
arrify('🦄');
//=> ['🦄']
arrify(['🦄']);
//=> ['🦄']
arrify(new Set(['🦄']));
//=> ['🦄']
arrify(null);
//=> []
arrify(undefined);
//=> []
Supplying null
or undefined
results in an empty array.
MIT © Sindre Sorhus