new-array

WebJar for new-array

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

new-array
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

new-array
WebJar for new-array
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mattdesl/new-array

Download new-array

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/new-array/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>new-array</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/new-array/
implementation 'org.webjars.npm:new-array:1.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/new-array/
implementation ("org.webjars.npm:new-array:1.0.0")
'org.webjars.npm:new-array:jar:1.0.0'
<dependency org="org.webjars.npm" name="new-array" rev="1.0.0">
  <artifact name="new-array" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='new-array', version='1.0.0')
)
libraryDependencies += "org.webjars.npm" % "new-array" % "1.0.0"
[org.webjars.npm/new-array "1.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

new-array

stable

Creates a new dense array with the given size, optionally filled with a specified value.

var array = require('new-array')

array(2)
// > [ undefined, undefined ]

array(4, 0)
// > [ 0, 0, 0, 0 ]

array()
// > []

array(2).map((x, i) => i)
// > [0, 1]

Primarily motivated by the fact that new Array(n) produces an array of holes that does not play well with methods like Array#map().

Usage

NPM

arr = newArray(n[, value])

Returns a new dense array with length n (default 0), where each element is set to value (or undefined).

See Also

License

MIT, see LICENSE.md for details.

Versions

Version
1.0.0