end is treated as end-1 internally in the slice() method of the array. The slice() method does not change the original array. JavaScript’s Array slice() method returns a copy of the array as new array, For returning the new array it accepts parameters that are optional as well, a start which is inclusive and an end that is exclusive which means if you have passed 1 as start(index) and 3 as end(index) then slice will return a new copy of your given array which will contain two values(indexes).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |