The below code is almost identical to some code from Douglas Crockford's superb book JavaScript: The Good Parts, from pages 29-30. The only difference is that he adds the get_status property like so:
Quo.prototype.get_status=function() {
this.status=string;
}
My question is why his code runs OK but my little change, below, results in an error that says myQuo has no get_status method?
<script>
var Quo=function(string) {
this.status=string;
}
Quo.get_status=function() {
return this.status;
}
var myQuo=new Quo("confused");
alert(myQuo.get_status());
</script>