《JavaScript Definitive Guide》学习

Chapter 3. Datatypes and Values

1. Function:
引用
An important feature of JavaScript is that functions are values that can be manipulated by JavaScript code . In many languages, including Java, functions are only a syntactic feature of the language: they can be defined and invoked, but they are not datatypes. The fact that functions are true values in JavaScript gives a lot of flexibility to the language. It means that functions can be stored in variables, arrays, and objects, and it means that functions can be passed as arguments to other functions. This can quite often be useful.

  • function 是一种能被JavaScript代码操作的值。
  • 这种特性给JavaScript带来了语言上很大的灵活性。
  • 所以,这意味着functions能够被存为变量,数组,对象, 也意味着function能够以参数的形式传递给其他的函数。


 

你可能感兴趣的:(JavaScript)