CSML-by-Clevy/csml-engine

Slice returns an error when starting index is 0

bastienbot opened this issue · 0 comments

Describe the bug
Slice returns an error when starting index is 0

To Reproduce

do a = [0,1,2,3,4,5]
debug a.slice(0,2) // Null
debug a.slice(1,2) // 1

Improvements
It'd be nice to be able to start from the end with -1, like javascript. It'd be also very useful if csml could use the array length when the providing an ending key greater than the length:
[0,1,2,3].slice(0,42) => [0,1,2,3]