Ad
  • Custom User Avatar

    Triple equal '===' means equivalent in value and in type. Double equal '==' means equivalent in value.

    Try this: in your browser console, type
    1 == true

    true
    1 === true
    false

    Also try this:
    5 == '5'

    true
    5 === '5'
    false

    The reason for these answers is that number 1 is 'truthy' as they say, and is equal to the value of true, but the type of 1 is a number, and the type of true is a boolean. Similarly, the type of 5 is a number, and the type of '5' is a string, even though their values are equal.

  • Custom User Avatar

    Excellent explanation! Comments like these make codewars a great place to learn how to code.