Created
July 27, 2015 09:37
-
-
Save jjokela/10eb4bcc3294936db11c to your computer and use it in GitHub Desktop.
This file contains 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
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