또 다른 함수
(function(){
alert("hi");
}); ();-호출
function a(){
alert("hi");
}
var b=a();
b();
-호출
인자
argument
전역변수
:어디서든 사용할 수 있는 변수
매개변수
:밖과 안을 이어주는 매개체
printDan
function printDan(dan,end){
console.log("=="+dan+"단==");
for(var i=1; i<=end;i++){
console.log(dan+""+i+"="+dani);
}
}
printDan(3,3)
boolean:true false 값만 나오는 것
var a =1
typeA(a)
console.log(typeA);
number
==>이렇게 알려줌
문장:string
number
string
boolean
return
돌려주는 값
돌려주지만 출력은 안해준다
function plus (num1,num2){
return num1 + num2;
}
var plusNum=plus(10,20);
console.log("plusNum1:"+plusNum);
==>plusNum:30