• masterspace@lemmy.ca
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    11 months ago

    The explanation given to you makes it sound like == was deliberately designed to be a more convenient version of ===

    I mean technically == was deliberately designed to be a more convenient version of other languages’ == operator… Just specifically more convenient for light UI stuff since that was all JavaScript was supposed to be used for at the time (or all they thought it would be used for).

    But give programmers a way to write and execute a small script and someone will eventually use that to try and write an emulator that emulates the computer it’s running on, so the web evolved into more complicated applications, and then that convenience turned out to be wildly inconvenient, not to mention horribly unexpected for programmers coming from other languages, so then they added the triple equality to match other languages.