lukehaas / RunJS

RunJS is a JavaScript playground for macOS, Windows and Linux. Write code with instant feedback and access to Node.js and browser APIs.
https://runjs.app
2.05k stars 45 forks source link

Splice function misbehaving #577

Closed gopichand2131 closed 1 year ago

gopichand2131 commented 1 year ago
runjs_splice
lukehaas commented 1 year ago

@gopichand2131 this is correct. The return value for splice is an array containing deleted elements. You are not deleting any elements so the returned array is empty.

Screenshot 2023-08-21 at 09 57 42

Please take a look here for more detail on splice: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice

lukehaas commented 1 year ago

@gopichand2131 is it clear why the returned value is an empty array?