8
arantr
8y

Seriously, what is going on here?

Comments
  • 2
    whitespace?
  • 2
    have you tried turning it off and on again?
  • 0
    @thassiov Yeah it must be caused by a  
  • 0
    And the solution is:
    element.textContent.trim().replace(/\u00a0/g, " ")

    Fuck, I'm out of here
  • 1
    His is when testing strings for exact content can be more trouble than it's worth. If I need to test stings in my unit tests I'll usually define a range in regex.
  • 0
    *this
  • 0
    Reference error, look up equality in javascript. May not be the same object... Using == or ===?
Add Comment