Front-End - Main Menu/html5 + CSS3 + JavaScript (종합 예제)

ex10 - arrowFunction

ITRecipe 2023. 3. 2. 10:19
<!DOCTYPE html>
<html lang = "ko">
<head>
<meta charset="UTF-8">
<title>arrowFunction</title>
</head>
<body>

<h3>화살표 함수 사용법</h3>
<hr>

<p id="demo"></p>

<script type="text/javascript">
//함수를 변수 hello로 정의
/*
let hello = function(){
   return "Hellow Worlds!!";
}
*/
//함수를 화살표 함수로 처리

let hello = () => {
   return "Hello Worlds!!";
};
document.getElementById("demo").innerHTML = hello();
</script>
</body>
</html>

'Front-End - Main Menu > html5 + CSS3 + JavaScript (종합 예제)' 카테고리의 다른 글

ex10 - forIn  (0) 2023.03.02
ex10 - for of 문법  (0) 2023.03.02
ex10 - class  (0) 2023.02.28
ex10 - constObject  (0) 2023.02.28
ex10 - constArray  (0) 2023.02.28