New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

array-spread

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-spread

Concat a matrix array into one flattened array.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-16.67%
Maintainers
1
Weekly downloads
 
Created
Source

array-spread

Why

Concat a matrix array into one flattened array.

Installation

$ npm install --save array-spread

Usage

var arraySpread = require('array-spread');

var matrix = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
];

console.log(arraySpread(matrix));

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

Test

npm test

How does it work?

var matrix = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
];

console.log([].concat.apply([], matrix));

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

ES6

let matrix = [
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]
];

console.log([...matrix]);
// Output:
[1, 2, 3, 4, 5, 6, 7, 8, 9]

Contribution

Contributions are appreciated.

License

MIT-licensed. See LICENSE.

Keywords

FAQs

Package last updated on 15 Dec 2015

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

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