As of ECMAScript 2015, when the deleteCount argument of Array.prototype.splice is undefined, it is automatically set to the difference of the array's length and the start value. In other words, everything from (and including) the start argument is removed from the array.
As of ECMAScript 2015, when the
deleteCount
argument of Array.prototype.splice is undefined, it is automatically set to the difference of the array's length and the start value. In other words, everything from (and including) thestart
argument is removed from the array.As such, the following should work:
Instead, Baobab throws an error because only one argument has been provided to the
splice
call.