Some unit tests are failing. Upon debugging, I traced the problem here
var a = "USD 1,234.12"
var b = "USD 1,234.12"
console.log(a === b)
String a
has been generated by a currency formatter library and String b
has been written by a unit test developer.
I don't understand why these two strings that look the same aren't considered equal by ===
. What is happening here?