[Javascript] Objects and Functions
Posted Answer1215
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[Javascript] Objects and Functions相关的知识,希望对你有一定的参考价值。
What makes objects different is that we can create more of them. Every time we use the {}
object literal, we create a brand new object value:
let shrek = {};
let donkey = {};
Functions:
for (let i = 0; i < 7; i++) { let dig = function() { // Do nothing }; console.log(dig); }
The snippet above contains one function definition in the code, but it creates seven function values! This is why separating these concepts is important.
|
Every time we execute a line of code that contains a function declaration, a brand new function value appears in our universe.
|
以上是关于[Javascript] Objects and Functions的主要内容,如果未能解决你的问题,请参考以下文章
2. creating and destroying objects
016: class and objects > 多重继承与多态的例子
Interaction Between Threads and Securable Objects