函数是 JavaScript 中的基本组件之一。JavaScript 中的函数类似于过程——一组执行任务或计算值的语句。但要成为函数,这个过程应该接受输入并返回与输入存在某些明显关系的输出。要使用一个函数,你必须将其定义在你希望调用它的作用域内。
闭包是由捆绑起来(封闭的)的函数和函数周围状态(词法环境)的引用组合而成。换言之,闭包让函数能访问它的外部作用域。在 JavaScript 中,闭包会随着函数的创建而同时创建。
Learn about the Document interface, including its constructor, properties, and methods, specifications and browser compatibility.
In JavaScript, everything is an object. An object is a collection of related functionality stored in a single grouping. You can create your own objects, but that is quite advanced. The built-in objects that your browser contains allow you to do lots of useful things. For example, we first...
eval: The Object.eval() method used to evaluate a string of JavaScript code in the context of an object, however, this method has been removed. every: The every() method tests whether all elements in the array pass the test implemented by the provided function. every: The every() met...
The Document Object Model (DOM) connects web pages to scripts or programming languages by representing the structure of a document—such as the HTML representing a web page—in memory. Usually it refers to JavaScript, even though modeling HTML, SVG, or X
Learn about the CSSStyleSheet interface, including its constructor, properties, and methods, specifications and browser compatibility.
JavaScript methods index 以前翻译过但现在没有与最新的英文文档保持同步(英文文档更新于 323 天前)。 我来译! JavaScript properties index 以前翻译过但现在没有与最新的英文文档保持同步(英文文档更新于 323 天前)。 我来译! Lexical grammar 貌似某位同学的翻译工作半途而废了。。。 我来译! Standard built-...
JavaScript 语⾔的核⼼包含⼀些普遍的编程特点,以让你可以做到如下的事情:在变量中储存有⽤的值。⽐如,我们⽤prompt请求输⼊⼀个新的名字,然后把那个名字储存到⼀个叫 name 的变量.对⼀段⽂本(在编程中被称为“字符串”)进⾏操作。在上⾯的例⼦中,我们取出字符串 "Player 1: "...
Usage: mdn <search terms> Examples $ mdn defineproperty Opens theObject.definePropertydocumentation on MDN in your browser. $ mdn css transitions Opens theUsing CSS transitionsdocumentation on MDN in your browser. $ mdn array#Methods Opens theArraydocumentation on MDN in your browser and jumps down...