Adding Subclass to Main Class in JavaScript -
var test = { hoi : { test: function(e) { console.log(e); } }, c: function(e) { console.log(e); } }; test.c("hey 1"); test.hoi.c("hey 2"); i've doing classes exercising, can't find manage put subclasses main class.
test.hoi.c doesn't exist; test.hoi.test use:
test.hoi.test("hey 2"); each dot digs step deeper structure of object.
Comments
Post a Comment