CJCoding With Joseph
15free / daySign inCreate account

Loose vs Strict Equality

The variable text holds the string "5" and the variable number holds the number 5. Write two if / else statements. The first uses loose equality == and prints Loosely equal or Not loosely equal. The second uses strict equality === and prints Strictly equal or Not strictly equal. Loose equality converts the string to a number before comparing; strict equality also requires the same type, so the two results differ.

Expected Output:

Loosely equal
Not strictly equal

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.