javascript - Use a method in a callback -
question being edited. sorry changes. please don't provide answers @ moment :)
if declare object in javascript:
var myobject = { function myfunction() { console.log('hi!'); } }
why errors?
wouldn't rather be:
var myobject = { myfunction : function(){ console.log('hi!'); } }
how call method:
myobject.myfunction()
Comments
Post a Comment