How Do I Test for null in a .where()

Is this how I test for a value being null in a .where() on the client side?

.where(`response`, null, "==")

Who wrote this? This syntax doesn’t look correct, it should be:
Did you use Wappler’s UI to write that?

And now my suggestion, use triple equal sign to check the variable type as well (===)

It’s the punctuation converted by the Wappler UI into HTML entities

1 Like

Oh, right, I forgot about that :sweat_smile: The .where formatter is inside an HTML attribute, that’s why Wappler adds those.

Triple equal sign then

What is the meaning of === in words?

Variables can have multiple types, such as Number, String or null itself

== performs equal check, disregarding the type
1 == “1” is true

=== performs equal check, including the type
1 === “1” is false

I’m guessing using triple equal is not strictly necessary in your situation, but it was my first thought hence my suggestion

Are you experiencing any problems with your where formatter?

1 Like

Thanks @apple! I’ve learned something new…

I’ve not implemented the formatter yet… I thought rather than try various ways of doing it, I’d check the best way beforehand!