Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Created March 5, 2021 15:47
Show Gist options
  • Save NyaGarcia/f211855c115314dc7b9a403917b8e5ff to your computer and use it in GitHub Desktop.
Save NyaGarcia/f211855c115314dc7b9a403917b8e5ff to your computer and use it in GitHub Desktop.
Comparison between arrow and traditional function prototypes
function sayHello(name) {
return `Hello ${name}!`;
}
console.log(sayHello.prototype);
// Output: {...}
const sayHelloArrow = name => `Hello ${name}`;
console.log(sayHelloArrow.prototype);
// Output: undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment