<!doctype html>

<html>

<head>

<meta charset="utf-8">

<title>함수</title>

</head>

<script>

function test(){

console.log("HI~");

}


// 패러미터 X, 변환 값 X

function test1(a){

console.log(a);

}


// 패러미터 O, 변환 값 X

function test2(a,b){

console.log(a+b);

}

// 패러미터(인자)를 두 개 받아 하나로 출력

test();           // 패러미터(인자)가 없으므로 출력값을 직접 입력하여 출력

test1("HI!");   // 'a' 인자에 "Hi!" 라는 문구를 넣어 출력

test2(10,20);  // '숫자'+'숫자' 이므로 결과는 '30'이 출력



</script>

<body>

</body>

</html>



=== 결과창 === 





' > JavaScript' 카테고리의 다른 글

(16.5.26) document.write , prompt  (0) 2016.05.26
(16.5.26) 박스겹치기-div활용  (0) 2016.05.26
(16.5.26) 연산자 실습  (0) 2016.05.26

+ Recent posts