[JavaScript] 함수(Function)
캐떠린
💡 JavaScript에서는 자료형을 명시적으로 표현이 불가능하다. number, string, boolean, object 변수 생성 → int num → number num → var num 반환값 선언 → 자료형 기재 불가능 배열 선언 → int[] nums → var nums ✓ Function 매개변수에는 var를 쓸 수 없음! 그냥 변수명만 사용해야 함! 형식 1) 매개변수가 있는 경우, function 생성 + 해당 function 호출 function m1() { console.log('m1'); } m1(); // m1 2) 매개변수가 없는 경우, function 생성 + 해당 function 호출(매개변수 입력) function m3(name, age) { console.log(name..