What is Arrow Function in java script

Hello friends today i am sharing with you what is arrow function in java script and how to write

This is include in ES6 in java script which you can more clean and less code as compare to regular function.

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>


    <script>
        console.log("Hello Arrow Function")

        const
        function hello() {
            console.log("hello friends kase ho aap log");
        }
        hello();

        const hello1 = () => {
            console.log("hello friends arrow function kase ho aap log");
        }
        const hello1 = () =>
            "hello friends arrow function kase ho aap log";

        console.log(hello1());
        console.log("Array Java Script")

        let a = ["hfkdsj", 65565, 498, 61, "Hello"];
        console.log(a);

        a.forEach(myFunction);

        function myFunction(value) {
            console.log(a);
        }
    </script>

</body>

</html>

In this example you can check it out.

Leave a Comment