惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
S
SegmentFault 最新的问题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
Jina AI
Jina AI
H
Help Net Security
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
L
LangChain Blog
Recorded Future
Recorded Future
F
Full Disclosure
Google DeepMind News
Google DeepMind News
Microsoft Security Blog
Microsoft Security Blog
I
InfoQ
GbyAI
GbyAI
B
Blog RSS Feed
T
The Blog of Author Tim Ferriss
Engineering at Meta
Engineering at Meta
A
About on SuperTechFans
M
MIT News - Artificial intelligence
爱范儿
爱范儿
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Y
Y Combinator Blog
B
Blog
WordPress大学
WordPress大学
Blog — PlanetScale
Blog — PlanetScale
W
WeLiveSecurity
MongoDB | Blog
MongoDB | Blog
Cloudbric
Cloudbric
N
News and Events Feed by Topic
The Cloudflare Blog
月光博客
月光博客
博客园 - 三生石上(FineUI控件)
有赞技术团队
有赞技术团队
D
DataBreaches.Net
博客园 - 【当耐特】
T
Troy Hunt's Blog
V
Visual Studio Blog
V2EX - 技术
V2EX - 技术
Apple Machine Learning Research
Apple Machine Learning Research
博客园 - 司徒正美
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Google Online Security Blog
Google Online Security Blog
The GitHub Blog
The GitHub Blog

博客园 - 廖勇军

关于c++的头文件依赖 增强资源管理器右键功能,含源代码 VC中结构体的内存布局 进程间共享句柄三种方式 SocanCode连接Oracle的方法 SocanCode7之模板编写 不用再纠结反射影响效率了 IIS7.0中使用MVC3,静态页正常,其它404 ashx的使用 一起来灭掉IE6! iis express感觉还不错 关于sqlite使用entity framework的布署问题 - 廖勇军 - 博客园 负margin实现div的左右排版 原来Jquery.load的方法可以一直load下去 错误1067进程意外终止 关于省市联动的问题想法 javac编译多个带package文件 远程服务器返回了错误 NOTFOUND Java程序放到Linux上出现的问题
javascript总结
廖勇军 · 2012-07-08 · via 博客园 - 廖勇军

以下是网上看到的英文原版内容,我用自己的理解解释一下而已。

Functions are first-class objects.

函数是类对象的开始。例如 function classa(){this.a='a';} 就是一个类,里面有一个属性a。


Methods are just functions attached to objects.

方法只是附加到对象上的函数。就是说对象中的方法就是函数。感觉函数是万能的了,类和方法都是函数。


You can add methods to classes at any time (even after instances have been created).

你可以添加一个方法到一个类中,即使这个类的实例已经创建。也就是说你创建了一个类的实例后,再给这个类添加方法,则这个实例就立即有了这个方法。一点很奇特,有点像我熟悉的C#中的扩展函数。但这扩展得也太灵活了,任何时候任何地方都能扩展。


Individual objects can have their own methods.

单独的对象可以有其自己的方法。这个不用解释了


Class constructors'' are just functions.

类的构造函数只是一个函数。第一点的例子已经很明白了。


Functions, being objects, can have their own properties.

方法就是一个对象,有自己的属性。同上


You can call functions with fewer (or more) arguments than the function is declared to take.

你可以在调用方法时,使用的参数比方法中定义的多和少。少了好理解,后面的都是undefined,多了的话,函数内部使用argumetns去取,不取则无用而已。


If no value is passed for a function argument, it gets the value undefined.

如果没有值对应上函数的参数,则参数值为undefined。同上