Skip to content

Instantly share code, notes, and snippets.

@jjokela
Created July 27, 2015 09:37
Show Gist options
  • Save jjokela/10eb4bcc3294936db11c to your computer and use it in GitHub Desktop.
Save jjokela/10eb4bcc3294936db11c to your computer and use it in GitHub Desktop.
var obj = {};
var func = function(){ return 'moro' };
var func2 = function(){ return 'no terve terve'};
console.log(func());
obj.prop = func;
console.log(obj.prop());
func.funk = func2;
// Functions as objects.
// object with a property 'prop' has a function 'func'
// that function has a property 'funk, which is a function
console.log(obj.prop.funk());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment