반응형
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 |
Tags
- dhcp
- SQLD
- Port
- oracle
- Layer2
- OSI
- 자바
- Next
- network
- ip 할당
- next.js
- 네트워크
- nextjs
- Layer4
- java
- Packet
- class
- Layer
- 오라클
- 함수형
- Mac
- Linux
- Router
- frame
- 프로그래밍
- 자격증
- 스위치
- Python
- 포트
- 자바8
Archives
- Today
- Total
목록JS (2)
BEER&DEV

// ex) 특정 변수값 복사하기 const someData = "이걸 복사하고 싶어요"; let tempInput = document.createElement("input") tempInput.value = someData; // 굳이 body일 필요는 없습니다. 아무 엘리먼트나 지정해서 작성해도 무관합니다. document.body.appendChild(tempInput); tempInput.select(); document.execCommand("copy"); document.body.removeChild(tempInput);
DEV/Javascript
2024. 3. 25. 13:41

OptionalChaning(물음표 한개) (?) 객체뒤에 물음표를 붙이면 객체가 undefined, null 일 경우 코드를 중지하고 undefined를 반환함. 즉, 있어도 없어도 될때 사용하면 좋음 Nullish Coalescing(물음표 두개) (??) 물음표 두개를 사용 null 또는 undefined일 경우 오른쪽 수식을 따름 ?? 과 || 의 차이점 let response = optionalObj ?? result; 위 코드를 보면 optionalObj이 null, undefined 라면 result가 response에 할당된다. " || " 과 " ?? " 차이점이라면 " || "은 boolean 값도 판단하지만 Nullish Coalescing(물음표 두개)는 아님. 즉, Nullish ..
DEV/Typescript
2021. 12. 15. 12:13