diff --git a/src/lib/libs/values/string.ts b/src/lib/libs/values/string.ts index 32f6247..c31f0b2 100644 --- a/src/lib/libs/values/string.ts +++ b/src/lib/libs/values/string.ts @@ -41,8 +41,9 @@ export const String = (() => { offset = +offset; return string.indexOf(self, search, offset, false); } - public lastIndexOf(search: string, offset = 0) { + public lastIndexOf(search: string, offset?: number) { const self = unwrapThis(this, "string", String, "String.prototype.lastIndexOf"); + if (offset == null) offset = self.length; offset = +offset; return string.indexOf(self, search, offset, true); }