본문 바로가기
프로그래밍

2023-05-07 javascript

by AandBB 2023. 5. 7.

When we define funtion, if we do not write 'return statement', then function returns 'undefined' value.

 

We can assign some values to parameters.

function introduce(name, age, nationality='South Korea'){

}

We call these parameters as optional parameters. Optional parameters should be defined last like the example.

 

We should define constant variable like this const MY_NUM = 1;

 

We can select same codes by typing control + D

 

The type of variables matters when we compare values in switch statement.

We should use === when we compare values in if statement.

 

In switch statement, we don't need ( ) after 'case' like this case 1

We don't need break; in default :

'프로그래밍' 카테고리의 다른 글

2023-05-16 javascript_array  (0) 2023.05.16
2023-05-13 javascript  (0) 2023.05.13
2023-05-11 javascript  (0) 2023.05.11
2023-05-08 javascript  (0) 2023.05.08
2021/12/16 C언어 메모(백준)  (0) 2021.12.16