티스토리 뷰
== 연산자의 경우: 형변환을 자동으로 한 후 값들을 비교한다.
=== 연산자의 경우: 형변환을 하지 않고 값 그 자체를 비교한다.
<!doctype html>
<html>
<head>
</head>
<body>
<h2>Operator == vs ===</h2>
<p id="equal" style="cursor: pointer;">"1" == 1 클릭</p>
<p>If the two operands are not of the same type, JavaScript converts the operands then applies strict comparison. If either operand is a number or a boolean, the operands are converted to numbers if possible; else if either operand is a string, the other operand is converted to a string if possible. If both operands are objects, then JavaScript compares internal references which are equal when operands refer to the same object in memory.</p>
<br>
<p id="scriptEqual" style="cursor: pointer;">"1" === 1 클릭</p>
<p>Returns true if the operands are strictly equal (see above) with no type conversion.</p>
<script type="text/javascript">
(function() {
document.getElementById("equal").onclick = function(){
if("1" == 1){
alert("true");
}
else{
alert("false");
}
};
document.getElementById("scriptEqual").onclick = function(){
if("1" === 1){
alert("true");
}
else{
alert("false");
}
};
})();
</script>
</body>
</html>
- Total
- Today
- Yesterday
- MainActor
- 스프링 프레임워크(spring framework)
- 스프링 시큐리티(spring security)-http basic 인증
- In App Purchase
- 람다식(lambda expression)
- jstl(java standard tag library)-core
- await
- 진수 변환
- 문자 자르기
- React
- 제품 등록
- 인텔리제이(intellij)
- jsp 오픈 소스
- java.sql
- REST API
- System.Diagnostics
- java 키워드 정리
- system.io
- 스프링 시큐리티(spring security)
- 특정 문자를 기준으로 자르기
- docker
- 메이븐(maven)
- java-개발 환경 설정하기
- jstl(java standard tag library)
- .submit()
- nl2br
- java web-mvc
- 스프링 프레임워크(spring framewordk)
- 표현 언어(expression language)
- error-java
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |