箭头函数是否比类似的常规(匿名)函数更具性能? [英] Is an arrow function more performant than a similar regular (anonymous) function?

查看:81
本文介绍了箭头函数是否比类似的常规(匿名)函数更具性能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 MDN :

箭头函数表达式在语法上是常规函数表达式的紧凑选择,尽管没有与this,arguments,super或new.target关键字的绑定.

An arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this, arguments, super, or new.target keywords.

大概,没有绑定比绑定具有更高的性能.

Presumably, not binding is more performant than binding.

推荐答案

与类似的常规(匿名)功能相比,箭头功能的性能如何?

How is an arrow function more performant than a similar regular (anonymous) function?

不是.两者都是 function 类型,并且性能差异可以忽略不计.

It isn't. Both are function type, and the performance difference is negligible.

这篇关于箭头函数是否比类似的常规(匿名)函数更具性能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆