var Quo = function (string) {
this.status = string;
document.writeln( '0'+this.status )
};
// Give all instances of Quo a public method
// called get_status.
Quo.prototype.get_status = function ( ) {
document.writeln( '<br>1'+ this.status )
return this.status;
};
// Make an instance of Quo.
var myQuo = new Quo("confused");
document.writeln('<br>2'+myQuo.get_status( )); // confused
//document.writeln('<br>3'+myQuo.status); // confused
document.writeln('yyyyy');
// Make an array of 2 numbers and add them.
var array = [3, 4];
document.writeln(array);
//var sum = add.apply(nulls, array); // sum is 7
document.writeln('ttttt');
// Make an object with a status member.”
var statusObject = {
status: 'A-OK'
};
// statusObject does not inherit from Quo.prototype,
// but we can invoke the get_status method on
// statusObject even though statusObject does not have
// a get_status method.
var status = Quo.prototype.get_status.apply(statusObject);
// status is 'A-OK'
document.writeln('<br>4'+myQuo.get_status( )); // confused
document.writeln('<br>5'+ status); // confusedq
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.