OdZarref

js

Jun 4th, 2020 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. VARIAVEIS
  2. const nome = 'Marcelo
  3. let idade = 18
  4. const verificar = true
  5. let sobrenome = undefined
  6. const corSelecionado = null
  7. typeof(sobrenome)
  8.  
  9. NUMEROS
  10. Number('2.0')
  11. Number.isInteger(numero)
  12. numero.toFixed(2)
  13. numero.toString()
  14.  
  15. STRINGS
  16. texto.charAt(3)
  17. texto.charCodeAt(3)
  18. texto.indexOf('a')
  19. texto.substring(1)
  20. texto.concat(texto2)
  21. texto.replace('e', '3')
  22. string.split(',')
  23.  
  24. ARRAYS
  25. valores.length
  26. valores.push(novoValor)
  27. valores.pop()
  28. delete valores[0]
  29.  
  30. ESCOPO
  31. var: tem escopo global e escopo de função
  32. let: tem escopo global, escopo de função e escopo de bloco
  33.  
  34. DATAS
  35. data = new Date(0)
  36. data.getTime()
  37.  
  38. OBJETOS
  39. Object.assign
  40. Object.freeze()
  41. Object.keys()
  42. Object.values()
  43. Object.defineProperty
  44. Object.entries
  45. objeto.__proto__
  46. Object.setPrototypeOf()
  47. Object.preventExtension()
  48. Object.isExtensible()
  49. Object.seal()
  50. Object.isSealed()
  51. JSON.stringify()
  52. super
  53.  
  54. ARRAY
  55. aprovados = new Array(1, 2, 3)
  56. aprovados.push('4')
  57. aprovados.sort()
  58. delete aprovados[1]
  59. aprovados.splice(1, 2, 'elemento1', 'elemento2')
  60. aprovados.length
  61. aprovados.pop()
  62. aprovados.shitft()
  63. aprovados.unshift(5)
  64. novoArray = aprovados.slice(2, 4)
  65.  
  66. /*
  67. function pessoa() {
  68.    this.idade = 0
  69.  
  70.    setInterval(function () {
  71.        this.idade++
  72.        console.log(this.idade)
  73.    }.bind(this), 1000)
  74. }
  75.  
  76. new pessoa
  77. */
  78.  
  79. ARROW FUNCTION
  80. dobro = a => 2 * a
Add Comment
Please, Sign In to add comment