<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JavaScript Arrow function (Find the length of string)</title>
</head>
<body>
<pre> <!-- Use pre element for work document.writeln() method -->
<script type="text/javascript">
var emp_name = [
"Opal Kole",
"Max Miller",
"Beccaa Moss",
"Paul Singh",
"Ken Myer"
];
var static_ans = emp_name.map(function(n){ return n.length });
var arrow_ans = emp_name.map( n => n.length );
document.writeln("static answer: " + static_ans);
document.writeln("Arrow function answer: " + arrow_ans);
</script>
</pre>
</body>
</html>