0 points

Array.prototype.slice() - JavaScript | MDN


dashboard

Sun May 17 2020 03:12:16 GMT+0000 (UTC)

Posted by @UlisesVilla #javascript

let fruits = ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']
let citrus = fruits.slice(1, 3)

// fruits contains ['Banana', 'Orange', 'Lemon', 'Apple', 'Mango']
// citrus contains ['Orange','Lemon']
content_copy Copy

simple slice( )

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice