Skip to content

Yooooomi/numbermap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

numbermap

Simply adds a Map function to Number prototype

Initialization

require('numbermap')() It initializes .map to Number prototype

Example

Creating an array of 30 1's:

(30).map(e => 1)
//Returns [1, 1, 1, 1, ..., 1]

Creating an array from 1 to n:

(n).map(e => e + 1)
//Returns [1, 2, 3, ..., n]

About

Add the feature to 'map' a number to quickly create sized Array. It basically loops over the number. Added in the number prototype

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published