Documente Academic
Documente Profesional
Documente Cultură
BÁSICO
R O G E R I O A N G E L I S K I
JAVASCRIPT NADA ALÉM
DO BÁSICO
R O G E R I O A N G E L I S K I
O QUE É BÁSICO?
E S C O P O
T H I S
P R O T O T Y P E
C Ó D I G O A S S I N C R O N O
E S 6 / E S 7 / . . . / E S ( N + 1 )
F U N Ç Õ E S I M P O R T A N T E S
M Ó D U L O S J S
D E S I G N P A T T E R N S
Escopo
protetor', pelo
Exemplo var
Exemplo let
Exemplo const
HOISTING
Em JavaScript, funções e variáveis são hoisted
(ou "levados ao topo"). Hoisting é um
Exemplo do Hoisting
CLOSURE
O escopo das closures segue o escopo onde ela
foi criada.
Exemplo closure
P o r q u e o this m u d a ?
O This
para o objeto.
Exemplo do this
Function.prototype.call()
fun.apply(thisArg, [argsArray])
Function.prototype.bind()
HERANÇA
Herança com o encadeamento de protótipos
"sacos" dinâmicos de
as próprias propriedades) e
objeto prototype.
CÓDIGO ASSINCRONO
ONDE A COISA COMEÇA A COMPLICAR
Fluxo assíncrono
com aquilo.
CALLBACK HELL
QUANDO O VOCÊ ABRE O ARQUIVO E JÁ
ENCONTRA O PROBLEMA
Promise
processamento assíncrono. Um
futuro ou nunca.
Resolve e Reject
});
ES6
arrow functions
destructuring
rest parameters
default parameters
classes
export/import
ESN + 1
Async e Await
Array.prototype.includes
O bject.values / O bject.entries
String padding
FUNÇÕES IMPORTANTES
M A P
F I L T E R
R E D U C E
S P L I C E
S L I C E
J O I N
S O M E
IIFE (Immediately Invoked Function Expression)
CERTA
Como construir um módulo isolado (ES6>)
IIFE
Como construir um módulo isolado (ES6<)
Import
Export