1 | I find myself writing `item = item instanceof Array ? item : [item]` a lot, so I decided to make a simple library to does
|
2 | it for me. A few examples:
|
3 |
|
4 | ```javascript
|
5 | toArray = require("toarray");
|
6 |
|
7 | console.log(toArray("hello-world!")); //["hello-world!"]
|
8 | console.log(toArray(["hello-world!"])); //["hello-world!"]
|
9 | console.log(toArray(undefined)); //[]
|
10 | ```
|