šŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more →
Socket
Sign inDemoInstall
Socket

repeat-element

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

repeat-element

Create an array by repeating the given value n times.

1.1.4
latest
Source
npm
Version published
Weekly downloads
12M
9.19%
Maintainers
1
Weekly downloads
Ā 
Created

What is repeat-element?

The repeat-element npm package is a simple utility that allows you to create an array of repeated values. It is useful when you need to generate a list with the same value multiple times without manually writing out each element.

What are repeat-element's main functionalities?

Repeat a single value

This feature allows you to repeat a single value a specified number of times to create an array. The first argument is the value to repeat, and the second argument is the number of times to repeat it.

var repeat = require('repeat-element');
var repeatedArray = repeat('a', 5);
// repeatedArray is ['a', 'a', 'a', 'a', 'a']

Other packages similar to repeat-element

Keywords

array

FAQs

Package last updated on 07 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts