Files
ValueScript/inputs/passing/stringMethods/lastIndexOf.ts
Andrew Morris f0d9c996e9 lastIndexOf
2023-03-13 21:18:58 +11:00

18 lines
347 B
TypeScript

// 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];
}