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

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -