“== vs === JavaScript” Respostas de código

javascript == vs ===

/**
* In js :
* == it convert the variable values to the same data type before performing comparison.
* example : comparison between string and interger data type
*/
(5 == "5") // returns true

// === it does not convert data type of variable before performing comparison.
// example:
(5 === "5") // return false
Adam Al-Rahman

== vs === JavaScript

== Equal to (1 == 1, 1 == "1") // equal in value ("1" is a string)
=== Equal value and equal type (1 === 1 but, 1 !== "1" // not equal type
Frail Flamingo

== vs === JavaScript


{
    "version": "0.1.0",
    "command": "node",
    "isShellCommand": true,
    "args": [
        "--harmony"
    ],

    "tasks": [
        {
            "taskName": "runFile",
            "suppressTaskName": true,
            "showOutput": "always",
            "problemMatcher": "$jshint",
            "args": ["${file}"]
        }
    ]
}

Grumpy Giraffe

o que difere entre três iguais e dois iguais

false == 0    =>  true
false === 0   =>  false

0 != false    =>  false
0 !== false   =>  true
Different Dingo

Respostas semelhantes a “== vs === JavaScript”

Perguntas semelhantes a “== vs === JavaScript”

Mais respostas relacionadas para “== vs === JavaScript” em JavaScript

Procure respostas de código populares por idioma

Procurar outros idiomas de código