代码示例:(标识:js_arrow_function_3)
<!DOCTYPE html>
<html>
<body>

<h2>JavaScript 箭头函数</h2>

<p>此例展示了没有括号或 return 关键字的箭头函数。</p>

<p id="demo"></p>

<script>
var hello;

hello = () => "Hello World!";

document.getElementById("demo").innerHTML = hello();
</script>

</body>
</html>
运行结果: