You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2023. It is now read-only.
This is a problem as Number.NaN is always greater then other numbers,
eg the following will always return false, even though expected true: compareTwoStrings("", "") > 0.9
I have temporarily got around this in my own project, by simply using:
if(a.length <= 1 && b.length <= 1)return a === b ? 1 : 0;
return compareTwoStrings(a, b);
Cheers,
Josh
The text was updated successfully, but these errors were encountered:
For some reason when both strings are 1 or less characters long, compareTwoStrings will return Number.NaN instead of expected 1 or 0.
Examples:
This is a problem as Number.NaN is always greater then other numbers,
eg the following will always return false, even though expected true:
compareTwoStrings("", "") > 0.9
I have temporarily got around this in my own project, by simply using:
Cheers,
Josh
The text was updated successfully, but these errors were encountered: