참조형 - Function
function hello(){
console.log('hello!')
}
hello() //call
hello!가 출력된다
function getNumber(){
return 123
}
console.log(getNumber())
123이 출력된다
타입은 number
만약
function getNumber(){
return 123
}
console.log(getNumber)
getNumber만 입력한다면 getNumber의 함수자체가 출력이 된다
타입은 function
const getNumber = function() {}
익명함수
const a = function() {
console('A')
}
const b = function(c){
console.log(c) // console('A') 라는 함수가 호출된다
c() //a 라는 함수를 호출하는것과 같은 개념
}
b(a)
블로그의 정보
개발 블로그👩💻
Blairj