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

smartface.io - Proper way to change color scheme for whole application -

javascript - three.js lot of meshes optimization -

Email notification in google apps script -