Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

make

v1.0.0arrow_drop_down
v1.0.0
v0.0.1
STATUS
Passing
DOWNLOADS
31
LICENSE
MIT
VISIBILITY
Public
PUBLISHED
2 years ago
SIZE
550 B
Wraps a value with an array.
2 contributors
Use make in your project ?
Copied
npm i @bit/bit.utils.array.make
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
revert changes
reload
toggle layout
maximize
makeArray(1); // => [1]
makeArray([1]); // => [1]
makeArray(null); // => []
modifieddraft
chevron_left
chevron_right
makeArray (
val:*
) : [*]

Wraps a value with an array.

Example
makeArray(1) // => [1]
 makeArray([1]) // => [1]
 makeArray(null) // => []
Argument
val: *
Returns
[*]

Test Summary

#makeArray() should wrap an empty string with an array

Pass

#makeArray() should return an empty array as nil value was passed

Pass

#makeArray() should return the same array reference if an existing array was passed

Pass