# How to initialize a new array with values in JavaScript

> Learn how to initialize a new JavaScript array of a given length filled with the same value, using the Array() constructor with the ES6 fill() method.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2018-10-02 | Updated: 2019-01-21 | Topics: [JavaScript](https://flaviocopes.com/tags/js/) | Canonical: https://flaviocopes.com/how-to-initialize-array-with-values/

Simple solution:

```js
Array(12).fill(0)
```

`fill()` is a new method introduced in [ES6](https://flaviocopes.com/es6/).
