var foo = function ( ) {
var a = 3, b = 5;
var bar = function ( ) {
var b = 7, c = 11;
// At this point, a is 3, b is 7, and c is 11
a += b + c;
// At this point, a is 21, b is 7, and c is 11
};
// At this point, a is 3, b is 5, and c is not defined
document.write( 'a=',a,'b=',b);
bar( );
// At this point, a is 21, b is 5
document.write( 'a=',a,'b=',b);
};
foo();
var quo =function (status) {
return {
get_status: function ( ) {
return status;
}
};
};
// Make an instance of quo.
/*var myQuo = quo("amazed");
document.write('<br> myQuo is  ',myQuo);
document.writeln('<br> my status is  ',myQuo.get_status( ));
var test= quo('baff');
*/
var test=new quo('maxed ');
console.log('myQuo is ',test.get_status());
var level=12;
var hex = level.toString(16);
console.log('level=',level);
console.log('hex=',hex);
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.