3-05.Arrow Function

2023. 3. 29. 17:25Javascript/자바스크립트 제대로 배워볼래?

<!DOCTYPE html>
<html>
<head>
    <title>Document</title>
</head>
<body>
    <script>
        function hello(){
            console.log("Hello World");
            return "Hello World";
        }

        var hello = function hello(){
            console.log("Hello World");
            return "Hello World";
        }

        var hello = () => {
            console.log("Hello World");
            return "Hello World"
        }

        var hello = () => "HelloWorld";

        var hello = (fullName, lastName) => "HelloWorld" + fullName + lastName;
        console.log(hello("권소영", "또또")); //HelloWorld권소영또또

        
        var hello = fullName => "HelloWorld" + fullName
        console.log(hello("권소영")); //HelloWorld권소영
    </script>
</body>
</html>

'Javascript > 자바스크립트 제대로 배워볼래?' 카테고리의 다른 글

3-07.Object Literal Syntax Extension !!! 0_0  (0) 2023.03.30
3-06.Template Literals  (0) 2023.03.29
3-04.Rest Parameter  (0) 2023.03.29
3-03.Default Function Parameter  (0) 2023.03.29
3-02.Scope  (0) 2023.03.29