<!doctype html>
<head>
<style>
/* CSS comes here */
</style>
<title>Arrow Function</title>
</head>
<body>
<h2>Arrow Function Example</h2>
<script>
// Arrow function for sum
let add = (a,b) => {return a+b}
let sum = add(10,20)
document.write(" Sum of 10 and 20 is: " + sum);
// Arrow function - without return
let show = () => "Hello from arrow function";
// Calling function
document.write("<br>"+show());
// Arrow function with default params
let newAdd = (a,b=1) => a+b;
let newsum = newAdd(10);
document.write("<br/>Result is: " + newsum);
</script>
</body>
</html>