lastIndexOf

This commit is contained in:
Andrew Morris
2023-03-13 21:18:58 +11:00
parent 3f9a52a461
commit f0d9c996e9
2 changed files with 76 additions and 7 deletions

View File

@@ -0,0 +1,17 @@
// test_output! [[4,2,4,6],[-1,-1]]
export default function () {
const positive = [
" xxx".lastIndexOf("x"),
"xxx ".lastIndexOf("x"),
" xxx ".lastIndexOf("x"),
" xyxyxy ".lastIndexOf("xy"),
];
const negative = [
" xxx ".lastIndexOf("x", 5),
"abc".lastIndexOf("abcd"),
];
return [positive, negative];
}