JS: Add: Test cases use of returnless function in findLast and findLastIndex

This commit is contained in:
Napalys
2024-11-15 14:42:11 +01:00
parent fcb65534a8
commit 7250099f6c

View File

@@ -107,3 +107,13 @@ class Bar extends Foo {
console.log(super()); // OK.
}
}
() => {
let equals = (x, y) => { return x === y; };
var foo = [1,2,3].findLastIndex(n => { equals(n, 3); }) // NOT OK -- Currently not flagged, but should be.
console.log(foo);
var foo = [1,2,3].findLast(n => { equals(n, 3); }) // NOT OK -- Currently not flagged, but should be.
console.log(foo);
}