Quotes fail my to.equal tests, how to go around them?

I’m trying to compare the response.json to a variable, things seem to be working fine, I get the same result but the test fails -
AssertionError: expected 3879896 to equal '3879896'
and I suppose it is because of the quotes ?

In this case I’m checking numbers, however earlier with the same script I was comparing emails and it was working.

Hi @theToncheff,

There are a few different data types in JavaScript, including string and number which are not written the same. Numbers are written without quotation marks and strings are written in between quotation marks.
You won’t be able to use the same variable to compare both a string and a number.

You can read more about data types in JavaScript here:

1 Like