Study of JavaScript inheritance