JavaScript (JS) เป็นภาษาโปรแกรมชนิดหนึ่ง, ภาษามีขนาดเล็ก, อาศัยตรวจแปลภาษา, มีคุณสมบัติ first-class functions. คนส่วนใหญ่จะรู้จักว่าเป็นภาษาสคริปต์สำหรับหน้าเวบ แต่ปัจจุบันมีการนำไปใช้ใน สภาพแวดล้อมอื่นๆอีกจำนวนมากที่ไม่ใช่ browser เช่น node.js หรือ Apache CouchDB. JS เป็นภาษาแบบ prototype-based, multi-paradigm, dynamic scripting สนับสนุนสไตล์การเชียนแบบ object-oriented, imperative และ declarative ( เช่น การโปรแกรมแบบ functional) อ่านเพิ่มเติม
ส่วนนี้ของเวปไซท์มีไว้สำหรับภาษา JavaScript โดยเฉพาะ, เนื้อหายังไม่เจาะจงกับการเขียนหน้าเวป หรือ สภาพแวดล้อมอื่นๆ. สำหรับเนื้อหาเกี่ยวกับ APIs สำหรับการเขียนเวปโดยตรงนั้นสามารถดูได้ที่ Web APIs และ DOM
มาตรฐานของ JavaScript คือ ECMAScript. นับตั้งแต่ปี 2012 เป็นต้นมา browser ยุคใหม่ทั้งหมดรองรับการทำงานตามมาตรฐาน ECMAScript 5.1 อย่างสมบูรณ์ ในขณะที่ browser ที่เก่ากว่านั้นจะรองรับอย่างน้อย ECMAScript 3. ในวันที่ 17 มิถุนายน 2015 ECMA International ได้ตีพิมพ์มาตรฐาน ECMAScript รุ่นที่ 6 ซึ่งมีชื่อเรียกอย่างเป็นทางการว่า ECMAScript 2015 แต่เป็นที่รู้จักโดยทั่วไปว่า ECMAScript 6 หรือ ES6. นับตั้งแต่นั้นมาตรฐาน ECMAScript ก็จะถูกปรับปรุงทุกปี. สำหรับเอกสาร(ที่ท่านอ่าน) นี้อ้างถึงมาตรฐานฉบับร่างรุ่นล่าสุด, ซึ่งปัจจุบันคือ ECMAScript 2017.
อย่าสับสน JavaScript กับ ภาษา Java. ทั้ง "Java" and "JavaScript" เป็น ตราสินค้าจดทะเบียนของบริษัท Oracle ในสหรัฐอเมริกาและประเทศอื่นๆ. ทั้งสองภาษามีความต่างอย่างมากทั้งด้าน วากยสัมพันธ์ (syntax), ความหมาย (semantics) และการใช้งาน
Tutorials
Learn how to program with JavaScript.
Introductory
- JavaScript Guide
- If you are new to JavaScript, this guide will walk you through the language.
- JavaScript technologies overview
- Introduction to the web browser JavaScript landscape.
- Introduction to Object Oriented JavaScript
- Introduction to the concepts of object oriented programming in JavaScript.
Intermediate
- A re-introduction to JavaScript
- An overview for those who think they know about JavaScript.
- JavaScript data structures
- Overview of available data structures in JavaScript.
- Equality comparisons and sameness
- JavaScript provides three different value-comparison operations: strict equality using
===
and loose equality using==.
Advanced
- Inheritance and the prototype chain
- Explanation of the widely misunderstood and under-estimated prototype-based inheritance.
- Strict mode
- A restricted variant of JavaScript.
- JavaScript typed arrays
- JavaScript typed arrays provide a mechanism for accessing raw binary data.
- Memory Management
- Memory life cycle and garbage collection in JavaScript.
Reference
Browse the complete JS reference documentation.
- Standard objects
- Get to know standard built-in objects
,Array
Boolean
,Date
,Error
,Function
,JSON
,Math
,Number
,Object
,RegExp
,String
,Map
,Set
,
,WeakMap
WeakSet
, and others. - Expressions & operators
- Learn more about the behavior of JavaScript's operators
instanceof
,typeof
,new
,this
, and more. - Statements & declarations
- Learn how
do-while
,for-in
,for-of
,try-catch
,let
,var
,const
,if-else
,switch
, and more JavaScript statements and keywords work. - Functions
- Learn how to work with JS functions to develop your applications.
Tools & resources
Helpful tools while writing and debugging your JavaScript code.
- Firefox Developer Tools
- Scratchpad, Web Console, JavaScript Profiler, Debugger, and more.
- Firebug
- Edit, debug, and monitor CSS, HTML, and JavaScript live in any web page.
- JavaScript Shells
- A JavaScript shell allows you to quickly test snippets of JavaScript code.
- TogetherJS
-
Collaboration made easy.
- Stack Overflow
- Stack Overflow questions tagged with "JavaScript".
- JavaScript versions and release notes
- Browse JavaScript's feature history and implementation status.
{{CommunityBox("JavaScript", "js-engine.internals", "mozilla.dev.tech.js-engine.internals", "js", "ES discuss|https://esdiscuss.org/|esdiscuss.org|ECMAScript standard discussion mailing list||SpiderMonkey|https://wiki.mozilla.org/JavaScript|Project page|Contribute to the JavaScript Engine||Twitter|https://twitter.com/SpiderMonkeyJS|@SpiderMonkeyJS|SpiderMonkey updates on Twitter")}}