Call functions from function inside an object (object literal)

前端 未结 3 690
粉色の甜心
粉色の甜心 2020-12-13 03:49

I\'m learning to use object literals in JS, and I\'m trying to get a function inside an object to run by calling it through another function in the same object. Why isn\'t t

3条回答
  •  再見小時候
    2020-12-13 04:26

    That code is only a declaration. You need to actually call the function:

    runApp.init();
    

    Demo: http://jsfiddle.net/mattball/s6MJ5/

提交回复
热议问题