源代码 :
点击运行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>开源教程(ossoft.cn)</title> </head> <body> <h2>JavaScript 箭头函数</h2> <p>IE11 及更早 IE 版本不支持箭头函数。</p> <p id="demo"></p> <script> const x = (x, y) => { return x * y }; document.getElementById("demo").innerHTML = x(5, 5); </script> </body> </html>
运行结果