查看“︁JavaScript”︁的源代码
来自康健生活
←
JavaScript
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
[[编程语言 | 返回上一级]] == 简介 == JavaScript 的前身是 cmm 语言,由 Nombas 公司于 1992 年开发完成。受其启发,Netscape 公司的 Brendan Eich 仅用 10 天就完成了 JavaScript 最初版本。随后在 1996 年秋天 Brendan Eich 开发了第一款 JavaScript 引擎 SpiderMonkey。 JavaScript 包括三个部分,即 ECMAScript、DOM 和 BOM。ECMAScript 是 JavaScript 的核心语法,DOM 是 HTML 和 XML 的应用程序 API 接口,控制文档结构,BOM 是浏览器对象模型。 Javascript 语言属于 Lambda 语言的一种。 [[/描述|描述]] == 特性 == 垃圾回收、动态绑定。 == 实现 == {| class="wikitable" |- | ECMAScript || 语言 || 示例 |- | BOM(Browser Object Model) || 浏览器对象模型 || 示例 |- | DOM(Document Object Model) || 文档对象模型 || W3C(万维网联盟) 标准 |} == AST == [[/ast|AST]] == 具体语法树/混合语法树(Concrete Syntax Tree、CST) == == 分析 == === 词法分析/扫描器(Lexical Analysis/scanner) === 词法分析器将代码字符串转为 token === 语法分析/解析器(Syntax Analysis/parser) === === 预发分析 === == 转换 == == 编译 == === 编译器 === 示例: [https://github.com/jamiebuilds/the-super-tiny-compiler the-super-tiny-compiler]、[https://github.com/ftomassetti/LangSandbox LangSandbox] == ES6 == === ES6 modules === == 保留字和关键字 == 需要完善。 === 保留字 === {| class="wikitable" |- | break || case || catch || continue || default || delete || do || else |- | finally || for || function || if || in || instanceof || [[/new|new]] || return |- | switch || this || throw || try || typeof || var || void || while |- | with || || || || || || || |} === 关键字 === {| class="wikitable" |- | abstract || boolean || byte || char || class || const || debugger || double |- | enum || export || extends || final || float || goto || implements || import |- | int || interface || long || native || package || private || protected || public |- | short || static ||[[/super|super]] || synchronized || throws || transient || volatile || |} == 注释 == === 块注释 === <nowiki>/* */</nowiki>,来自于 <code>PL/I</code>(Programming Language One) 的语言。 安全性:如果被注释的内容含有正则表达式,也许会被破坏注释内容。 == 字面量 == === 对象字面量 === == 标识符 == 标识符是指变量、属性、函数的名称、函数的参数,由字母、数字、下划线、美元符组成,以字母、下划线、美元符开头。 {| class="wikitable" |- | 字母 || 中文、英文、日文、韩文等(Unicode统一编码制) || 16位编码制 |- | 数字 || 0~9 || |- | 下划线 || _ || |- | 美元符 || $ || |} === 原则 === * 标识符区分大小写 * 标识符<code>名称</code>不能为关键字和保留字 * 标识符<code>属性名称</code>可以为关键字和保留字 === 命名规范 === {| class="wikitable" |- | 匈牙利命名法 || 驼峰命名法 || 帕斯卡命名法 |} ==== 行为状态 ==== <pre> isShow: '是否显示', isVisible: '是否可见', isLoading: '是否处于加载中', isConnecting: '是否处于连接中', isValidating: '正在验证中', isRunning: '正在运行中', isListening: '正在监听中'</pre> ==== 属性状态 ==== <pre> disabled: '是否禁用', editable: '是否可编辑', clearable: '是否可清除', readonly: '只读', expandable: '是否可展开', checked: '是否选中', enumberable: '是否可枚举', iterable: '是否可迭代', clickable: '是否可点击', draggable: '是否可拖拽'</pre> == 变量和变量作用域 == 变量、声明变量、变量作用域(词法作用域=静态作用域、作用域链、执行环境、声明提前)、let、const、暂时性死区(temporal dead zone)、重复声明、非声明变量 == 严格模式指令 == {| class="wikitable" |- | use strict || 示例 |- | use asm || 示例 |- | use stricter || 示例 |- | use babel || 示例 |- | any other strings like this in the prologue || 示例 |} === 严格模式保留字 === {| class="wikitable" |- | implements || interface || let || package || private || protected || public || static || yield |} == 数据类型 == === 基本数据类型 === [[/基本数据类型|基本数据类型]](简单数据类型、原始数据类型、值类型)。 {| class="wikitable" |- | [[/Number|Number]] || 示例 || 示例 |- | [[/Null|Null]] || 示例 || 示例 |- | [[/String|String]] || 示例 || 示例 |- | [[/Boolean|Boolean]]|| 示例 || 示例 |- | [[/Undefined |Undefined]] || 示例 || 示例 |- | [[/BigInt|BigInt]] || || |} === 复杂数据类型 === 复杂数据类型(对象类型、引用类型)。 {| class="wikitable" |- ! rowspan=6| Object | [[/object|object]] | 狭义的对象 |- | [[/array|array]] | 数组 |- | [[/function|function]] | 函数 |- | RegExp | |- | symbol | |- | [[/Date|Date]] | |} === 数字类型 === {| class="wikitable" |- | [[/双精度浮点数|双精度浮点数]] || BigInt(数据类型-BigInt)|| 定点数 |} === 概念类型 === 不存在的类型,或通过其他类型进行解释的类型(替代的),或伪概念。 {| class="wikitable" |- | [[/整型|整型]] |} === other === {| class="wikitable" |- | Reference || ECMAScript || 描述 delete、typeof和赋值操作符的操作行为。 |} === 判断方法 === 判断数据类型的三种方法 {| class="wikitable" |- | [[/typeof|typeof]] 运算符 || 使用广泛但不精确 |- | [[/instanceof |instanceof]] 运算符 || 示例 |- | [[/constructor|constructor]] || |- | [[/Object.prototype.tostring.call|Object.prototype.toString]] 方法|| 示例 |} === 类型转换 === === 问题 === {| class="wikitable" |- | [[/原始类型与对象类型|原始类型与对象类型]] |} == 运算符 == * [[/逻辑运算|逻辑运算]] 逻辑判断使用 <code>==</code> 而不是 <code>===</code> === 移位运算符 === {| class="wikitable" |- | [[/左位移|左位移]] || [[/右位移|右位移]] |} === 平方 === {{leftrightflex|<syntaxhighlight lang="javascript"> 3**2</syntaxhighlight>|{{consoleout|<pre> 9 </pre>}}}} [[/扩展运算符|扩展运算符]] === 问号 === # 可选链操作符。表达式 <syntaxhighlight lang="javascript" inline> a.b?.c</syntaxhighlight>,等价于 <syntaxhighlight lang="javascript" inline> a.b && a.b.c</syntaxhighlight>。 # 空值合并运算符。表达式 <syntaxhighlight lang="javascript" inline> a ?? 'kangkk'</syntaxhighlight>,等价于 <syntaxhighlight lang="javascript" inline> (a !== undefined && a !== null) ? a : 'kangkk'</syntaxhighlight>。 == 实现 == {| class="wikitable" |- | ECMAScript || 语言核心 || 科学计数法 || polyfill |- | BOM || 浏览器对象模型 || [[/浮点数|浮点数]] || 反应路由器 |- | DOM || 文档对象模型 || 特殊的 Number 值 || [[/获取元素|获取元素]] |} == 语法 == {| class="wikitable" |- | [[/语句|语句]] || [[/注释|注释]] || [[/标识符|标识符]] || 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 || 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 || 示例 || 示例 || 示例 |} == 函数 == JavaScript 的函数主要基于词法作用域(lexical scoping),并且函数是顶级对象。 === arguments === === eval === === 常用函数 === {| class="wikitable" |- | [[/防抖|防抖]] || [[/节流|节流]] || [[/函数重载|函数重载]] |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} {| class="wikitable" |- | [[/replace|replace]] || [[/postMessage|postMessage]] || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} === IIFE === 立即调用函数表达式(Immediately Invoked Function Expression)。 <blockquote><pre> (() => {})();</pre></blockquote> 其写法众多。 <syntaxhighlight lang="javascript"> (() => {})(); (function(){})(); (function(){}()); const foo = function(){}(); true && function(){}(); true, function(){}(); !function(){}(); ~function(){}(); -funxtion(){}(); +function(){}(); new function(){}(); void function(){}();</syntaxhighlight> === 高阶函数(higher-order function) === === 纯函数 === 纯函数是指不依赖于上下文环境,不改变其作用域之外的上下文环境的函数,其返回值由输入参数决定。 === 柯里化 === === 偏函数 === === 回调函数 === == JavaScript == * [[/对象|对象]] * [[/阐述|阐述]] * [[/代码技巧|代码技巧]] * [[/相关题库|相关题库]] == 内存 == 内存空间 * [[/内存|内存]] {| class="wikitable" |- | [[/栈内存|栈内存(stack)]] || [[/堆内存|堆内存(heap)]] || 池 || [[/Buffer|Buffer(堆外内存)]] |} == 媒体 == {| class="wikitable" |- | [[/FileReader|FileReader]] || [[/Image|Image]] || [[/HTMLImageElement|HTMLImageElement]] |- | [[/ImageData|ImageData]] || [[/Uint8ClampedArray|Uint8ClampedArray]] || [[/ImageBitmap|ImageBitmap]] |- | 示例 || 示例 || 示例 |} == 对象 == === 无类型 === 无类型对象系统(class-free)。 === 全局对象 === 全局对象(the globar object) === other === {| class="wikitable" |- | [[/canvas|canvas]] || [[/console|console]] || [[/instanceof|instanceof]] || [[/Promise|Promise]] || [[/XSRF|XSRF]] || [[/constructor|constructor]] || [[/Object.prototype.tostring.call|Object.prototype.tostring.call]] || [[/setTimeout|setTimeout]] || [[/setimmediate|setimmediate]] |- | [[/throw|throw]] || [[/while|while]] || Infinity || [[/Object.defineProperty|Object.defineProperty]] || Object.freeze || apply || [[/Proxy|Proxy]] || [[/indexOf|indexOf]] |- | [[/valueOf|valueOf]] || [[/map|map]] || [[/Error|Error]] || [[/set|set]] || Reflect || 示例 || 示例 || 示例 |} === window === * [[/浏览器长宽|浏览器长宽]] ==== navigator ==== {| class="wikitable" |- | [[/userAgent|userAgent]] || 示例 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} === document === ==== constructor ==== {| class="wikitable" |- | [[/Document()|Document()]] |} ==== properties ==== {| class="wikitable" |- | activeElement || <s>alinkColor</s> || <s>all</s> || <s>anchors</s> || <s>applets</s> || <s>bgColor</s> || body || characterSet |- | childElementCount || children || compatMode || contentType || currentScript || defaultView || designMode || dir |- | doctype || documentElement || documentURI || <s>domain</s> || embeds || <s>fgColor</s> || firstElementChild || forms |- | <s>fullscreen</s> || fullscreenElement || fullscreenEnabled || head || <s>height</s> || hidden || images || implementation |- | lastElementChild || lastModified || <s>lastStyleSheetSet</s> || <s>linkColor</s> || links || location || mozSyntheticDocument || <s>origin</s> |- | pictureInPictureElement || pictureInPictureEnabled || plugins || pointerLockElement || <s>preferredStyleSheetSet</s> || readyState || referrer || <s>rootElement</s> |- | scripts || scrollingElement || <s>selectedStyleSheetSet</s> || styleSheets || <s>styleSheetSets</s> || timeline || title || URL |- | visibilityState || <s>vlinkColor</s> || <s>width</s> || <s>xmlEncoding</s> || <s>xmlVersion</s> || || || |} ==== methods ==== {| class="wikitable" |- | adoptNode() || append() || caretPositionFromPoint() || caretRangeFromPoint() || <s>clear()</s> || close() || createAttribute() || createAttributeNS() |- | createCDATASection() || createComment() || createDocumentFragment() || createElement() || createElementNS() || <s>createEntityReference()</s> || createEvent() || createExpression() |- | createNodeIterator() || createNSResolver() || createProcessingInstruction() || createRange() || createTextNode() || <s>createTouch()</s> || <s>createTouchList()</s> || createTreeWalker() |- | elementFromPoint() || elementsFromPoint() || <s>enableStyleSheetsForSet()</s> || evaluate() || <s>execCommand()</s> || exitFullscreen() || exitPictureInPicture() || exitPointerLock() |- | getAnimations() || getElementById() || getElementsByClassName() || getElementsByName() || getElementsByTagName() || getElementsByTagNameNS() || getSelection() || hasFocus() |- | hasStorageAccess() || importNode() || mozSetImageElement() || open() || prepend() || <s>queryCommandEnabled()</s> || <s>queryCommandSupported()</s> || querySelector() |- | querySelectorAll() || <s>registerElement()</s> || releaseCapture() || replaceChildren() || requestStorageAccess() || write() || writeln() || |} ==== events ==== {| class="wikitable" |- | afterscriptexecute || animationcancel || animationend || animationiteration || animationstart || beforescriptexecute || copy || cut |- | DOMContentLoaded || drag || dragend || dragenter || dragleave || dragover || dragstart || drop |- | fullscreenchange || fullscreenerror || gotpointercapture || keydown || <s>keypress</s> || keyup || lostpointercapture || paste |- | pointercancel || pointerdown || pointerenter || pointerleave || pointerlockchange || pointerlockerror || pointermove || pointerout |- | pointerover || pointerup || readystatechange || scroll || selectionchange || selectstart || touchcancel || touchend |- | touchmove || touchstart || transitioncancel || transitionend || transitionrun || transitionstart || visibilitychange || [[/wheel|wheel]] |} ==== inheritance ==== {| class="wikitable" |- | [[/Document_Node|Node]] || [[/Document_EventTarget|EventTarget]] |} ==== body ==== {| class="wikitable" |- | replaceChild || firstElementChild || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} === other === {| class="wikitable" |- | [[/MutationObserver|MutationObserver]] || [[/ResizeObserver|ResizeObserver]] ||[[/IntersectionObserver|IntersectionObserver]] |} == 定义声明 == {| class="wikitable" |- | [[/var|var]] || [[/let|let]] || [[/const|const]] || [[/class|class]] || [[/static|static]] || [[/yield|yield]] || [[/Symbol|Symbol]] || [[/import|import]] |} == Javascript 引擎(解析器) == javascript 引擎多数采用 JIT 编译技术。 {| class="wikitable" |- | JavaScriptCore(JSCore) || Safari |- | JaegerMonkey || Mozilla |- | Chakra || IE/Edge |- | [https://v8.dev/ V8] || Chrome/Node.js |- | Carakan || Opera |} == 媒体 == === WebRTC === == 技巧 == {| class="wikitable" |- | [[/值交换|值交换]] || 示例 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 教程 == == 兼容 == == 错误处理 == {| class="wikitable" |- | [[/try_catch|try{}catch{}]] ||[[/throw|throw]] |} == 语句 == === 循环语句 === {| class="wikitable" |- | while || switch || [[/for|for]] |} == 文件 == === 浏览器 === {| class="wikitable" |- | [[/createReader|createReader]] || [[/长宽|长宽]] || 示例 |} == 平台 == [[微信|微信]] == 判断 == {| class="wikitable" |- | [[/判断字符串|判断字符串]] || [[/判断数字|判断数字]] || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 事件 == === Passive Event Listeners === === 事件类型 === DOM 3 级事件。 {| class="wikitable" |- ! 标题文字 !! 标题文字 !! 标题文字 |- | UI 事件 || load || unload || abort || error || select || resize || scroll |- | 焦点事件 || focus || focusin || focusout || DOMFocusIn || DOMFocusOut || blur |- | 鼠标事件 || click || dbclick || mousedown || mouseup || mouseover || mousemove || mousewheel |- | 滚轮事件 || 示例 || 示例 |- | 文本事件 || [[/keydown|keydown]] || keyup || keypress || textInput |- | 键盘事件 || 示例 || 示例 |- | 合成事件 || 示例 || 示例 |- | 变动事件 || 示例 || 示例 |- | 变动名称事件 || 示例 || 示例 |} {| class="wikitable" |- | [[/事件|事件]] || [[/默认行为|默认行为]] || [[/事件冒泡|事件冒泡]] || [[/事件捕获|事件捕获]] || [[/事件委托|事件委托]] || [[/合成事件|合成事件]] |- | [[/wheel|wheel]] || [[/pointer|pointer]] || [[/addEventListener|addEventListener]] || [[/dispatchEvent|dispatchEvent]] || [[/drag|drag]] |} === EventBus(事件总线)=== == 位置相关 == {| class="wikitable" |- | [[/elementFromPoint|elementFromPoint]] || [[/元素位置|元素位置]] || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 实例 == {| class="wikitable" |- | [[/UUID|UUID]] || [[/GUID|GUID]] || [[/加密解密|加密解密]] || [[/url|url]] |- | [[/设备指纹|设备指纹]] || [[/帆布指纹|帆布指纹]] || [[/指针|指针]] || [[/暂存死区|暂存死区]] |- | [[/传参|传参]] || [[/数字与字符串|数字与字符串]] || [[/数组与字符串|数组与字符串]] || [[/尾递归|尾递归]] |} == 关键词 == {| class="wikitable" |- | [[/跨域|跨域]] || [[/迭代器|迭代器]] || [[/事件循环|事件循环]] || macroTask || [[/匿名函数|匿名函数]] || [[/continue|continue]] || [[/属性描述符|属性描述符]] || [[/哑变量|哑变量]] || [[/attribute|attribute]] |- | [[/拷贝|拷贝]] || 渐进式更新 || [[/进制|进制]] || [[/作用域|作用域(scope)]] || [[/模板渲染|模板渲染]] || [[/break|break]] || delete || 伪变量 || [[/createDocumentFragment|createDocumentFragment]] |- | [[/格式转换|格式转换]] || [[/闭包|闭包(Closure)]] || [[/super|super]] || [[/引用|引用(Reference)]] || [[/回调函数|回调函数]] || [[/return|return]] || 逃逸分析 || 内存泄露 || [[/正则|正则]] |- | [[/变量提升|变量提升]] || [[/解构|解构]] || [[/sleep|sleep]] || [[/delay|delay]] || [[/*|*]] || [[/new.target |new.target ]] || [[/连续赋值|连续赋值]] || [[/构造函数|构造函数]] || global |- | Copy-on-write || [[/立即调用函数表达式|立即函数]]||[[/封装|封装]] || [[/isNaN|isNaN]]||[[/websocket|websocket]] || [[/Hook|Hook]] || [[/节点|节点]] || [[/简单算法|简单算法]] || [[/链式操作|链式操作]] |- | [[/this|this]] || [[/call_bind_apply|call bind apply]] || [[/隐式转换|隐式转换]] || [[/微任务、宏任务|微任务、宏任务]] || [[/多重赋值|多重赋值]] || [[/循环遍历|循环遍历]] || [[/mouse|mouse]] || [[/按键|按键]] || [[/随机|随机]] |- | || [[/假值|假值(falsy)]] |} == 勘误 == {| class="wikitable" |- | [[const_var_let|const、var、let]] || 示例 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 方言 == {| class="wikitable" |- | [[/typescript|typescript]] |} == 脚手架 == == 框架 == {| class="wikitable" |- | [[/Svelte.js|svelte]] || [[/react|react]] || [[/vue.js|vue.js]] |- | [[/Koa|Koa]] || [[/Express|Express]] || |} == 代码库 == {| class="wikitable" |- | [[/URI.js|URI.js]] || [[/Falsy|Falsy]] || || [[/Cheerio|Cheerio]] || || || [[/Electron|Electron]] || [[/axios|axios]] || || [[/Prettier|Prettier]] || [[/Mockjs|Mockjs]] |- | [[/jquery|jquery]] || || [[/thinkjs|thinkjs]] |} == 请求 == {| class="wikitable" |- | [[/axios|axios]] || [[/fetch|fetch]] |} == 模块 == {| class="wikitable" |- | commonJS || AMD || CMD || UMD |} == 预处理器 == == Web API == {| class="wikitable" |- | [[/CustomEvent|CustomEvent]] || [[/HTMLButtonElement|HTMLButtonElement]] || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} === 存储 === 前端存储类别。 {| class="wikitable" |- | [[/cookie|Cookie]] || [[/sessionStorage|sessionStorage]] || [[/localStorage|localStorage]] |- | [[/IndexedDB|IndexedDB]] || Web SQL || 示例 |- | 示例 || 示例 || 示例 |} ==== 其他存储补充类别 ==== {| class="wikitable" |- ! 标题文本 !! 标题文本 !! 标题文本 |- | sharedb || https://github.com/share/sharedb || 示例 |- | ImmortalDB || https://github.com/gruns/ImmortalDB || 示例 |- | WebStorageCache || https://github.com/wuchangming/web-storage-cache || 示例 |- | lz-string || https://github.com/pieroxy/lz-string || 示例 |- | localForage || https://github.com/localForage/localForage || 示例 |- | pouchdb || https://github.com/pouchdb/pouchdb || 示例 |- | rxdb || https://github.com/pubkey/rxdb || 示例 |- | nedb || https://github.com/louischatriot/nedb || 示例 |- | Dexie || https://github.com/dexie/Dexie.js || 示例 |} == 场景 == {| class="wikitable" |- | [[/寻径|寻径]] || [[/画布|画布]] || [[/页面引导|页面引导]] |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 逻辑模块 == [[/逻辑模块|逻辑模块]] == 空间 == 经纬度计算[http://www.movable-type.co.uk/scripts/latlong.html Calculate distance, bearing and more between Latitude/Longitude points] === 参考 === * [https://developer.mozilla.org/zh-CN/docs/Web/API Web API 接口参考] * https://developer.mozilla.org/en-US/docs/Web/API/Document == 语法糖 == == HASH == 章节:[[/HASH|HASH]] == 其他 == {| class="wikitable" |- | [[/刷新页面|刷新页面]] || 虚值 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 隐式副作用 == == 开发者工具 == {| class="wikitable" |- | Fundebug || chrome |} == 编辑器 == {| class="wikitable" |- | [https://github.com/zenoamaro/react-quill react-quill] || [https://github.com/margox/braft-editor braft-editor] || [https://github.com/salgum1114/react-design-editor react-design-editor] |- | [https://github.com/udecode/plate plate] || [https://github.com/mdx-editor/editor editor] || [https://github.com/react-page/react-page react-page] |- | [https://github.com/mosch/react-avatar-editor react-avatar-editor] || [https://github.com/react-monaco-editor/react-monaco-editor react-monaco-editor] || [https://github.com/unlayer/react-email-editor react-email-editor] |- | [https://github.com/facebook/lexical lexical] || [https://github.com/Hufe921/canvas-editor canvas-editor] |} == 格式化 == 章节:[[/格式化|格式化]] == 练习题 == {| class="wikitable" |- |[[/青蛙跳台阶|青蛙跳台阶]] || 示例 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 分隔符 == 分隔符为 <code>;</code>。可省略。 有些场景可省略会导致误差,如。 {{hcdiff|head=编译结果导致误差|output=<syntaxhighlight lang="javascript"> a = b (function() { // ... })()</syntaxhighlight>|output2=<syntaxhighlight lang="javascript"> a = b(function() { // ... })()</syntaxhighlight>}} == 渲染点阵 == gpu渲染点阵 == 样式 == [[/css|css]] == 发布 == {| class="wikitable" |- | [[/Surge|Surge]] || 示例 || 示例 |- | 示例 || 示例 || 示例 |- | 示例 || 示例 || 示例 |} == 参考 == * [https://developer.mozilla.org/en-US/docs/Web/API Web API] * [https://spec.whatwg.org/ WHATWG] * [https://infra.spec.whatwg.org/ WHATWG infra] * https://jsbench.me/ == Version history == {| class="wikitable" style="text-align:center;" |- ! Version !! Release date !! Equivalent to !! Netscape<br />Navigator !! Mozilla<br />Firefox !! Internet<br />Explorer !! Opera !! Safari !! Google<br />Chrome |- | || 1995-9 || LiveScript || 2.0 beta || || || || || |- | || 1995-11 || LiveScript -> Javascript || 2.0 beta 3 || || || || || |- | style="background:red; color:yellow"| 1.0 || March 1996 || || 2.0 || || 3.0 || || || |- | 1.1 || August 1996 || || 3.0 || || || || || |- | 1.2 || June 1997 || ECMA-262 || 4.0-4.05 || || || 3 || || |- | 1.3 || October 1998 || ECMA-262 1st + 2nd edition || 4.06-4.7x || || 4.0 || 5 || || |- | 1.4 || || || Netscape<br />Server || || || 6 || || |- | 1.5 || November 2000 || ECMA-262 3rd edition || 6.0 || 1.0 || 5.5 (JScript 5.5),<br />6 (JScript 5.6),<br />7 (JScript 5.7),<br />8 (JScript 5.8) || 7.0 || 3.0-5 || 1.0-10.0.666 |- | 1.6 || November 2005 || 1.5 + array extras + array and string generics + [[E4X]] || || 1.5 || || || || |- | 1.7 || October 2006 || 1.6 + [https://developer.mozilla.org/en-US/docs/JavaScript/New_in_JavaScript/1.7?redirectlocale=en-US&redirectslug=New_in_JavaScript_1.7#Generators Pythonic generators] + iterators + let || || 2.0 || || || ||28.0.1500.95 |- | 1.8 || June 2008 || 1.7 + [[generator (computer programming)|generator expressions]] + [[closure (computer programming)|expression closures]] || || 3.0 || || 11.50 || || |- | 1.8.1 || || 1.8 + [[JSON#Native encoding and decoding in browsers|native JSON]] support + minor updates || || 3.5 || || || || |- | 1.8.2 || June 22, 2009 || 1.8.1 + minor updates || || 3.6 || || || || |- | 1.8.5 || July 27, 2010 || 1.8.2 + new features for ECMA-262 5th edition compliance || || 4.0 || || || || |- | || 2015-6-17 || ECMAScript 2015(ES6) || || || || || || |- | || 2016 || ECMAScript 2016 || || || || || || |- | || 2017 || ECMAScript 2017 || || || || || || |- | || 2018 || ECMAScript 2018 || || || || || || |- | || 2019 || ECMAScript 2019 || || || || || || |}
此页面嵌入的页面:
模板:Consoleout
(
查看源代码
)
模板:Double-columns
(
查看源代码
)
模板:Double-columns/style.css
(
查看源代码
)
模板:Hcdiff
(
查看源代码
)
模板:Hcdiff/style.css
(
查看源代码
)
返回
JavaScript
。
导航菜单
康健生活
搜索
user-page
通知
user-interface-preferences
个人工具
登录
五一
多读书,多运动,多到远处走走,再看看不一样的世界。