TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Invention of the Function Keyword

1 点作者 MrHus超过 2 年前

2 条评论

compressedgas超过 2 年前
&gt; Now why do people use const lambdas when there is a perfectly fine function keyword?<p>Because the hoisting of functions introduces mutable variables. The rule for variables is that everything should be const unless it is meant to be reassigned and then you use let.
MrHus超过 2 年前
I have a pet peeve: I find it annoying when someone uses &quot;const lambda&quot; to define named functions instead of using the &quot;function&quot; keyword.<p>I thought I&#x27;d air my grievances to the world.