gpt4 book ai didi

javascript - 函数和闭包可以替代 Javascript 中的类吗?

转载 作者:行者123 更新时间:2023-11-30 05:48:50 25 4
gpt4 key购买 nike

<分区>

我在阅读有关 AngularJS 的文章时在新闻组中看到了以下声明:

I have to say, though, that the more I use Angular, the less interest I have in creating classes. Classes are not where javascript is at! You can do pretty much everything you need with pure functions and closures and then you don't have to worry about the troublesome "this" and "that".

谁能解释一下“闭包”是什么意思。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com