Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bloody-collections

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bloody-collections - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

lib/iterator.js

1

index.js

@@ -19,2 +19,3 @@ module.exports = {

, range : require("./lib/range")
, iterator : require("./lib/iterator")
}

2

package.json

@@ -5,3 +5,3 @@ {

"issues" : "https://github.com/bloodyowl/collections/issues",
"version" : "0.4.1",
"version" : "0.5.0",
"scripts" : {

@@ -8,0 +8,0 @@ "test" : "tape test/*.js"

@@ -179,1 +179,18 @@ # collections

```
### `iterator(array) -> fn`
Returns a function that returns the next element in the array every time it is called.
Works with sparse arrays.
```javascript
var array = [1,2,3]
, fn = iterator(array)
fn() // 1
fn() // 2
array.push(4)
fn() // 3
fn() // 4
fn() // null
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc