Esta tradução está incompleta. Por favor, ajude a traduzir este artigo do Inglês.
JavaScript (JS) é uma linguagem de programação ligeira, com funções de primeira classe, que pode ser interpretada ou compilada JIT (just-in-time). Embora seja mais conhecida coma a linguagem de scripting para as páginas da Web, também é utilizada em muitos ambientes além de navegadores (inglês), tais como Node.js, Apache CouchDB e Adobe Acrobat. JavaScript é uma linguagem dinâmica, baseada em protótipos e que suporta os paradigmas de programação orientada a objetos, imperativa e declarativa (incluindo programação funcional). Leia mais sobre o JavaScript.
Esta seção do site é dedicada à própria linguagem JavaScript, e não a partes específicas das páginas da internet ou outros ambientes. Para informação sobre aa API específicas das páginas da internet, por favor consulte APIs da Web e DOM.
A norma do JavaScript chama-se ECMAScript. Em 2012, todos os navegadores modernos são totalmente compatíveis com a versão ECMAScript 5.1. Navegadores mais antigos suportam pelo menos ECMAScript 3. No dia 17 de junho de 2015, ECMA International publicou a sexta versão principal de ECMAScript, cujo nome oficial é ECMAScript 2015, e inicialmente era chamada ECMAScript 6 ou ES6. Desde então, as normas de ECMAScript são lançadas anualmente. Esta documentação refere-se à última proposta, que atualmente é ECMAScript 2018.
Não faça confusão entre JavaScript e a linguagem de programação Java. Tanto "Java" como "JavaScript" são marcas ou marcas registadas da Oracle nos E.U.A. e outros países. Contudo, estas linguagens de programação têm muitas diferenças na sua sintaxe, semânticas e utilização.
Tutoriais
Aprender a programar em JavaScript com guias e tutorials.
Para principiantes absolutos
Dirija-se ao nosso tópico sobre JavaScript se quer aprender esta linguagem mas não tem experiência alguma em programação. Seguem-se os módulos disponíveis:
- JavaScript - primeiros passos
- Responde a questões fundamentais como "o que é JavaScript?", "que aspeto tem a linguagem?", e "o que pode fazer?", além de discutir funcionalidades chave JavaScript como variáveis, strings, números e arrays.
- JavaScript - elementos constituintes
- Continua a abordagem às principais funcionalidades de JavaScript, tendo como foco os blocos de código utilizados mais habitualmente, tais como instruções condicionais, ciclos, funções e eventos.
Guia de JavaScript
- Guia de JavaScript
- Um guia muito detalhado de JavaScript, apropriado para pessoas com experiência em JavaScript ou noutra linguagem.
Intermediário
- Introducing JavaScript objects
- The object-oriented nature of JavaScript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we've provided this module to help you.
- Client-side web APIs
- When writing client-side JavaScript for web sites or applications, you won't go very far before you start to use APIs — interfaces for manipulating different aspects of the browser and operating system the site is running on, or even data from other web sites or services. In this module we will explore what APIs are, and how to use some of the most common APIs you'll come across often in your development work.
- 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
===, loose equality using==, and theObject.is()method.
Avançado
- Inheritance and the prototype chain
- Explanation of the widely misunderstood and under-estimated prototype-based inheritance.
- Strict mode
- Strict mode defines that you can not use any variable before initializing it. It is a restricted variant of ECMAScript 5, for faster performance and easier debugging.
- JavaScript typed arrays
- JavaScript typed arrays provide a mechanism for accessing raw binary data.
- Memory Management
- Memory life cycle and garbage collection in JavaScript.
- Concurrency model and Event Loop
- JavaScript has a concurrency model based on an "event loop".
- Introduction to using XPath in JavaScript
- This document describes the interface for using XPath in JavaScript internally, in extensions, and from websites.
Referência
Browse the complete JavaScript 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 and operators
- Learn more about the behavior of JavaScript's operators
instanceof,typeof,new,this, the operator precedence, and more. - Statements and 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 JavaScript's functions to develop your applications.
Ferramentas e recursos
Helpful tools for writing and debugging your JavaScript code.
- Firefox Developer Tools
- Scratchpad, Web Console, JavaScript Profiler, Debugger, and more.
- JavaScript Shells
- A JavaScript shell allows you to quickly test snippets of JavaScript code.
- TogetherJS
- Collaboration made easy. By adding TogetherJS to your site, your users can help each other out on a website in real time!
- Stack Overflow
- Stack Overflow questions tagged with "JavaScript".
- JavaScript versions and release notes
- Browse JavaScript's feature history and implementation status.
- JSFiddle
- Edit JavaScript, CSS, HTML and get live results. Use external resources and collaborate with your team online.
- JavaScript templates
- This page provides a list of JavaScript template systems.
- Plunker
- Plunker is an online community for creating, collaborating on and sharing your web development ideas. Edit your JavaScript, CSS, HTML files and get live results and file structure.