I have followed this answer to create a JS constructor:
function ObjectOne(value) {
var myVal = value;
}
function ObjectTwo(val) {
this.val = val;
}
And i want to access that variable like this: new ObjectOne("asdf").myVal
but that doesn't work (returns undefined)
EDIT: IM RETARDED
There was typo in ObejctOne and ObjectTwo, (ill bury myself deep)