Created
March 5, 2021 15:47
-
-
Save NyaGarcia/f211855c115314dc7b9a403917b8e5ff to your computer and use it in GitHub Desktop.
Comparison between arrow and traditional function prototypes
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
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