Skip to content

Instantly share code, notes, and snippets.

@IsTheJack
Created August 30, 2018 12:59
Show Gist options
  • Save IsTheJack/d49210e5cf20fe49dd3a1133386f86f9 to your computer and use it in GitHub Desktop.
Save IsTheJack/d49210e5cf20fe49dd3a1133386f86f9 to your computer and use it in GitHub Desktop.
Ao rodar o código abaixo, ocorre esse erro causado pelo 'numbersMap'. Por que? O que você faria para que esse erro parasse de acontecer?
const numbers = [1, 2, 3, 4, 5]
const numbersMap = numbers.map
const double = n => n * 2
const doubleNumbers = numbersMap(double)
// Uncaught TypeError: Array.prototype.map called on null or undefined
// at map (<anonymous>)
// at <anonymous>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment