Edit in JSFiddle

function A() {
    alert('construct A');
}

function B() {
    alert('construct B');
}

var X = new B();