Edit in JSFiddle
JavaScript
Result
function A() { alert('construct A'); } function B() { alert('construct B'); } var X = new B();