question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What about _.times function. There is es6 Array.from, which lets somewhat replicate that function. let out = Array.from(Array(10), (_,x) => x);

// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jacktuckcommented, Jun 5, 2018

@edysegura Not quite, lodash optionally takes a iteratee so OPs solution fits i think. _.times(n, [iteratee=_.identity])

2reactions
stevemaocommented, Jan 22, 2018

PR welcome!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lodash _.times() Method - GeeksforGeeks
The Lodash _.times() method Invokes the iteratee n times, returning an array of the results of each invocation. The iteratee is invoked with...
Read more >
Lodash - times method
Lodash - times method, Invokes the iteratee n times, returning an array of the results of each invocation. The iteratee is invoked with...
Read more >
Lodash Documentation
Creates a new array concatenating array with any additional arrays and/or values. Since. 4.0.0. Arguments. array (Array): The array to concatenate ...
Read more >
The lodash _.times method as an alternative to loops, forEach.
The repeat method in lodash is a way to just repeat a string a bunch of times. It is less advanced then the...
Read more >
index with lodash times method - javascript - Stack Overflow
I need to replicate a component "n" times. To do that I used the lodash method times . The problem is that I...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found