객체생성 Data 객체 var date = new Date() //Date객체 생성 //new - 메모리 생성 연산자 var year=date.getFullYear()//년 var month=date.getMonth()+1//월 var day = date.getDate()//일 var hour = date.getHours()//시 var min = date.getMinutes()//분 var sec = date.getSeconds()//초 if(month < 10){ month = "0"+month } if(day < 10){ day = "0"+day } var format = year+"-"+month+"-"+day+" " format = format + (hour+":"+min+":"+sec) doc..
function(함수) function hello(){//hello함수 정의 alert("hello!") } hello()//hello함수 호출 //--------------------------------------------------- function hello(n){//매개변수,파라미터 alert("hello:"+n);//hello:3 } hello(3)//함수 호출(function call) //hello함수를 호출하면서 입력으로 3전달 //매개변수=매개체변수 //매개체=둘사이를 연결하는 ~어떤것 //--------------------------------------------------- function add(n1,n2){//매개변수 2개 설정 return n1+n2;//더한값 반환 //함..