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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -