Skip to content

Instantly share code, notes, and snippets.

@sag1v
Created November 25, 2019 14:27
Show Gist options
  • Save sag1v/beb91b0f873b22d3033927b174015c4d to your computer and use it in GitHub Desktop.
Save sag1v/beb91b0f873b22d3033927b174015c4d to your computer and use it in GitHub Desktop.
Markdium-JavaScript - The prototype chain in depth
function double(num){
return num * 2;
}
double.toString() // where is this method coming from?
Function.prototype // {toString: f, call: f, bind: f}
double.hasOwnProperty('name') // where is this method coming from?
Function.prototype.__proto__ // -> Object.prototype {hasOwnProperty: f}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment