Can somebody help me?

How can I test if a variable is equal with nothing? I tried in playground with “null” but dosen’t work. Am i doing something wrong or the application does’t work with empty variables?

It depends on what you’re trying to do. For instance, if you want to check a math problem, then you would check if mathEquation === 0. If you’re working with boolean (true/false), then you would check if boolean === false. If you’re working with strings, check if string === ' ' (That is an empty space btw). And if you’re using an array, check if array = array() (An empty array). Null is also usable, but only on special occasions, just like everything else here.
Hope this helps! :blush:


It helped me a lot, ur a legend :heart::pray: