zaagan
6/29/2019 - 8:18 AM

Arrays Subset

Arrays Subset

var fruits = ["apple", "banana", "cherries", "durian"];

fruits.slice(0,1);
/*  ["apple"]  */

fruits.slice(1);
/*  ["banana","cherries","durian"]  */

fruits.slice(1,2);
/*  ["banana"]  */