[JavaScript] == 연산자 === 연산자

== 연산자와 ===연산자

  • ==(동등) 연산자 : 두 피연산자가 타입이 다를 경우 같은 타입으로 변환해서 두 값을 비교한다
  • ===(일치) 연산자 : 두 피연산자가 타입이 다를 경우 false를 리턴한다

타입 변환에 따른 잘못된 결과를 피하기 위해 jQuery 가이드 라인은 === 연산자를 권장한다

Author: Song Hayoung
Link: https://songhayoung.github.io/2020/07/08/Languages/JS/js_operator/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.