Arrow function in javascript

technical talkiess
0

Arrow functionn id the shord hand code of function. In the arrow function you donot need to write function put your condition in the arrow function. 


<!DOCTYPE html>

<html>

<body>

<script>


let sum = a => a/2;


// document.write(sum(20));


let obj1={

greeting:"good morning",

    name :["vishal","kale","asd"],

    test(){

    this.name.forEach((students)=>{

    document.write(this.greeting + " hi" + students);

    });

    }


}

obj1.test();

</script>

</body>

</html> 


Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)