Socket
Socket
Sign inDemoInstall

sliced

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sliced

A faster Node.js alternative to Array.prototype.slice.call(arguments)


Version published
Weekly downloads
754K
increased by3.33%
Maintainers
1
Weekly downloads
 
Created

What is sliced?

The 'sliced' npm package is a utility that provides a simple way to slice arrays and array-like objects. It is particularly useful for converting arguments objects into arrays and for slicing arrays in a concise manner.

What are sliced's main functionalities?

Slicing Arrays

This feature allows you to slice an array from a start index to an end index. In this example, the array [1, 2, 3, 4, 5] is sliced from index 1 to index 3, resulting in [2, 3].

const sliced = require('sliced');
const array = [1, 2, 3, 4, 5];
const result = sliced(array, 1, 3);
console.log(result); // Output: [2, 3]

Slicing Arguments Object

This feature is useful for converting the arguments object into an array and slicing it. In this example, the arguments object is sliced from index 1, resulting in [2, 3, 4].

const sliced = require('sliced');
function example() {
  const args = sliced(arguments, 1);
  console.log(args); // Output: [2, 3, 4]
}
example(1, 2, 3, 4);

Other packages similar to sliced

Keywords

FAQs

Package last updated on 05 Feb 2013

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