Irina Glushko 2389e7160b HW1 done | %!s(int64=3) %!d(string=hai) anos | |
---|---|---|
.. | ||
index.d.ts | %!s(int64=3) %!d(string=hai) anos | |
index.js | %!s(int64=3) %!d(string=hai) anos | |
license | %!s(int64=3) %!d(string=hai) anos | |
package.json | %!s(int64=3) %!d(string=hai) anos | |
readme.md | %!s(int64=3) %!d(string=hai) anos |
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