Normalizes a single element or an array of elements into an array. If the input is falsy, returns an empty array.
Optional
The element or array to normalize
an array containing the element(s), or an empty array if the input is falsy
David Hsing
normalize('foobar'); // ['foobar']normalize(['foo', 'bar']); // ['foo', 'bar']normalize(undefined); // []normalize(null); // [] Copy
normalize('foobar'); // ['foobar']normalize(['foo', 'bar']); // ['foo', 'bar']normalize(undefined); // []normalize(null); // []
Normalizes a single element or an array of elements into an array. If the input is falsy, returns an empty array.