1. array-ify
Turn anything into an array
array-ify
Package: array-ify
Created by: stevemao
Last modified: Mon, 13 Jun 2022 03:28:21 GMT
Version: 1.0.0
License: MIT
Downloads: 20,275,872
Repository: https://github.com/stevemao/array-ify

Install

npm install array-ify
yarn add array-ify

NPM version Build Status Dependency Status Coverage Status

Turn anything into an array

Install

 $ npm install --save array-ify

Usage

 var arrayify = require('array-ify');

arrayify('unicorn');
//=> ['unicorn']

arrayify(['unicorn']);
//=> ['unicorn']

arrayify(null);
//=> [null]

arrayify(undefined);
//=> [undefined]
  • arrify - Convert a value to an array

The difference that is this module does NOT turn null or undefined to an empty array.

License

MIT © Steve Mao

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code