标签:cells 技术 dig i++ appear ever str image imp
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
标签:cells 技术 dig i++ appear ever str image imp
原文地址:https://www.cnblogs.com/Answer1215/p/12363168.html