Fill Array

Create an array filled with a specific value.

Code

General
Array(length).fill(value);

Parameters

Length of the array

Value to fill with

Browser·fetch() may be limited by CORS

More JavaScript Snippets