Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- react Page
- Docker Windows 설치
- editor Quill
- Spring DTO
- react link
- javascript 기초
- springbatch chunk
- react jsx if
- Spring JPA
- step 테이블
- Spring Entity
- spring security
- 코드 중복제거
- react quill custom
- Spring CORS
- javascrpit 기초
- Spring Controller return
- SpringBatch 스키마
- react
- react forwardRef
- spring builder
- 텍스트가 많은 경우
- JPA Update\
- react Quill
- react react-router-dom v6
- spring
- springbatch
- Javascript
- javascript 함수
- JPA Insert
Archives
- Today
- Total
천천히 알아보는 코딩공부
javascript 연산자 본문
+ 연산자
var add1 = 1 + 2;
var add2 = 'my' + 'string';
var add3 = 1 + 'string';
var add4 = 'string' + 2;
console.log(add1); // (출력값) 3
console.log(add2); // (출력값) my string
console.log(add3); // (출력값) 1string
console.log(add4); // (출력값) string2
== (동등) 연산자와 === (일치) 연산자 차이점
- ==연산자는 비교하려는 피연산자의 타입이 다를 경우에 타입변환을 거친 다음 비교한다
- === 연산자는 피연산자의 타입이 다를 경우에 타입을 변경하지 않고 비교한다.
console.log(1 == '1'); (출력값) true
console.log(1 === '1'); (출력값) false
!! 연산자
- !! 의 역할은 피연산자를 불린값으로 변환하는 것이다.
console.log(!!0); // (출력값) false
console.log(!!1); // (출력값) true
console.log(!!'string'); // (출력값) true
console.log(!!''); // (출력값) false
console.log(!!true); // (출력값) true
console.log(!!false); // (출력값) false
console.log(!!null); // (출력값) false
console.log(!!undefined); // (출력값) false
console.log(!!{}); // (출력값) true
console.log(!![1,2,3]); // (출력값) true
'JavaScript > 기초' 카테고리의 다른 글
javascript 기초 1 - 함수(2) (0) | 2022.05.11 |
---|---|
javascript 기초 1 - 함수(1) (0) | 2022.05.11 |
javascript 배열 (0) | 2022.04.19 |
javascript 참조 타입의 특성, 프로토타입 (0) | 2022.04.19 |
javascript 기본 타입, 참조 타입(객체 타입) (0) | 2022.04.19 |
Comments