Closed dan-on closed 6 years ago
It's a bit more complicated.
I suppose you get the error because the user-agent string is not string, but undefined, null or something else. substr
is not a new function and it should be available to string instances even in very old browsers.
The semantics between substr
and substring
is not equal. So even if this pull request was merged, it would probably break, at least one of the changes.
Where do you get the error message?
You're right! I accidentally passed an object to the constructor.
Excuse me. Thank for the quick answer.
No problem, at least I've learned the subtle difference between both functions :-)
Hello!
The current build of your project, returns an error: "Uncaught TypeError: (a || "").substr is not a function"