Skip to content

jeromedecoster/array-funcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

array-funcs

A very limited subset of array functions I use every day

Install

npm i array-funcs

Package on npm

API

flatten([arg], [arg], [...])

Flatten nested Array and array-like objects like Arguments and NodeList

const flatten = require('array-funcs/flatten')

// [1, 2, 3]
flatten([1, [2, 3]])

function func() {
  return flatten(arguments)
}

// [1, 2, 3]
func([1, [2, 3]])

// [p, p, p]
flatten(document.querySelectorAll('p'))

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published