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
- angular modal
- prisma
- summary
- 앵귤러 모달
- route
- mysql if
- 검색
- angular route
- angular button
- flex-1
- Angular Router
- ApexChart
- Ionic modal
- modal
- Oracle LISTAGG 사용 예시
- 앵귤러 애니메이션
- Router
- 셀렉트박스 커스텀
- TAILWIND
- 호버
- angular animation
- ajax 사용 예시
- 아이오닉 스크롤 이벤트
- 모달
- 스크롤 이벤트
- formgroup
- egov spring ajax 사용 예시
- scroll
- 옵저버블
- 스크롤 이벤트 감지
Archives
- Today
- Total
목록typescript 선택적 매개변수 (1)
깜놀하는 해므찌로
typescript 선택적 매개변수, typescript ?
// 선택적 매개변수는 필수값보다 뒤에 위치해야 함 function hello(age:number | undefined, name?:string){ // ? : 선택적 매개변수 if(age !== undefined){ return `Hello ${name}. You are ${age}.`; }else{ return `Hello ${name || "world"}`; // name 이 있으면 name, 없을 땐 "world" } } function hello2(name = "world"){ // 위 함수와 동일한 구조 return `Hello, ${name}`; } let helloWorld = hello(undefined, "이름");
IT
2023. 5. 19. 11:46