I am working on a project and currently learning Javascript. Right now, I am wondering how I can create an object with a constructor, assign attributes to it, and later read and modify these attributes. I think I got the creation and the assigning part right, but I can't seem to access any of my object's attributes from the outside.
function initialize() {
var testPlane = jet("9C3476", currentAirport, "Palma De Mallorca", "02:45", "Departed");
alert("Never get to this point: " + testPlane.id);
}
function jet(id, from, to, expected, status) {
this.id = id;
this.from = from;
this.to = to;
this.expected = expected;
this.status = status;
this.position = from;
alert("Id: "+ id + " From:" + from + " To: " + to + " Expected: " + expected + " Status: " + status);
this.marker = new google.maps.Marker({
position : this.position,
icon : img,
map : map,
});
}