traditional function
<script> let myfunc = function (){ let a = "Teach"; let b = "Coders"; return (document.write(a+" "+b)); } myfunc(); } </script>Arrow function
<script> //Muliple Statement function with return keyword let myfunc2 = ()=>{ let a = "Teach"; let b = "Coders"; return (document.write(`<br> Hello, ${a} ${b}. This is a Arrow Function`)); } myfunc2() //Single Statement function with return keyword let myfunc3 = ()=> document.write("<br>Hello, I am Teach Coders."); myfunc3(); //Muliple Statement function with parameter and return keyword let add = (x, y)=>{ var c = x+y return(document.write(`<br>Total Value is :${x} + ${y}= ${c}`)) } add(90, 20) </script>
