💼 This rule is enabled in the ✅ recommended
config.
🔧 This rule is automatically fixable by the --fix
CLI option.
When calling {String,Array,TypedArray}#slice(start, end)
, omitting the end
argument defaults it to the object's .length
. Passing it explicitly is unnecessary.
const foo = string.slice(1, string.length);
const foo = array.slice(1, array.length);
const foo = string.slice(1);
const foo = bar.slice(1, baz.length);