TypeScript/tests/baselines/reference/spliceES6.js
Tom Jenkinson ddcf139668
make splice deleteCount required in es5.d.ts (#32643)
* make splice `deleteCount` required in es5.d.ts

In ES5 `deleteCount` is not an optional argument. If it is not provided it defaults to 0 as a side effect of `undefined` being converted to an integer.

In ES6 `deleleteCount` is optional, and it defaults to the length of the array minus the start index.

If you are targeting ES5 but don't provide `deleteCount` the behaviour will be different depending on the environment your build is running in.

fixes #32638

* update baselines
2020-03-12 14:28:14 -07:00

11 lines
185 B
TypeScript

//// [spliceES6.ts]
// see #32638
var arr1 = [0].splice(0)
var arr2 = [0].splice(0, 1)
//// [spliceES6.js]
// see #32638
var arr1 = [0].splice(0);
var arr2 = [0].splice(0, 1);