Since you’re testing for equality only, the straightforward solution is to stringify both terms in the comparison, thereby guaranteeing that you always compare a string with a string
That doesn't work if one number is 0.5 and the other number is the string 0.50. (I mean, it'll show they're unequal when in fact they're equal.) But hopefully you don't have your numbers as strings like that.
In reply to Re^2: Filtering array of strings and numbers
by msh210
in thread Filtering array of strings and numbers
by nysus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |