This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // PRIMEIRA PARTE => Definir Promises | |
| // Toda Promise tem 3 status: pending (pendente), fullfilled (bem-sucedida) e rejected (rejeitada) | |
| const promise = new Promise((resolve, reject) => { | |
| if (Math.floor(Math.random() * 2) === 0) { | |
| reject(new Error('A reject foi invocada')) | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 29/01/2022 | |
| // Escopo | |
| const name = 'Pedro' // <== escopo global, ou seja, fora de qualquer escopo de função | |
| // Escopo é o conjunto de variáveis que existem dentro de uma função | |
| function product(a, b) { | |
| console.log(name) // acessando a variável do escopo global dentro de uma função | |
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 27/01/2022 | |
| // Programação orientada à objetos e classes | |
| // Objeto literal | |
| // Na maioria das linguagens de programação, podemos usar objetos para representar conceitos da vida real. Nesse caso, nosso objeto representa uma pessoa: | |
| const pessoa = { | |
| nome: 'Carlos', | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 20/01/2022 | |
| // Métodos de array | |
| // Revisão callbacks | |
| // Declaração da callback | |
| function greet() { | |
| console.log('Hello world') | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 18/01/2022 | |
| // Arrays | |
| // Arrays ou listas são estruturas de dados que guardam vários valores no mesmo endereço de memória. As arrays organizam sua informação através da posição que elas ocupam dentro da array (ou seja, seu índice). A única forma de acessar um valor único dentro de uma array é sabendo seu índice. | |
| // Criando uma array | |
| // O que define uma array é o par de colchetes em volta de seus valores. Cada valor é separado do outro por uma vírgula. Cada valor separado por vírgula dentro de uma array é chamado de elemento. | |
| const fruits = ['banana', 'maçã'] | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 15/01/2022 | |
| // Truthy e Falsy | |
| // O javascript converte determinados valores pra true ou false de acordo com as seguintes regras | |
| // Falsy | |
| false | |
| '' | |
| 0 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // 13/01/2022 | |
| // Tipos de dados no JS | |
| // String | |
| // Declaração de variável | |
| // Esquerda do igual: nome da variável, que será usado futuramente pra acessar o valor da mesma | |
| // Direita do igual: o valor inicial da variável, o que será retornado quando acessamos a variável pelo nome | |
| const name = 'valor' | 
Week 1 Day 1 - Javascript: tipos, condicionais e loops
https://gist.github.com/rschpdr/08e41bbd941a22a710d8d24c73f8afb9
Week 1 Day 2 - Linha de comando do Git, Javascript: Objetos e Arrays
https://gist.github.com/rschpdr/89e59d4ea716a11a7460a4d2b9099a52
NewerOlder