how to call parent constructor?

Viewed 35025

Let's say I have the following code snippet.

function test(id) { alert(id); }

testChild.prototype = new test();

function testChild(){}

var instance = new testChild('hi');

Is it possible to get alert('hi')? I get undefined now.

5 Answers
Related