//iterates through each member of an object
var showMemberInfo = function (obj) {
if (!obj) {
console.info("info is undefined");
} else {
for (var i in obj) {
//member of type exist
console.info(i + " = " + obj[i]);
}
}
};
//my type
var myGlobalType = function () {
var self = this;
self.name = "Joe";
self.val = 12;
};
//instance of my type
var myInstance = new myGlobalType();
console.info(" --------------------my instance Insides --------------------\r\n");
console.info("my instance = " + myInstance);
console.info("my instance.prototype = " + myInstance.prototype);
console.info("my instance constructor = " + myInstance.constructor);
console.info("my instance show Member info called ");
showMemberInfo(myInstance);
console.info("my instance show Member info called on prototype");
showMemberInfo(myInstance.prototype);
console.info(" --------------------my Global Type Insides -------------------- \r\n");
console.info("my Global Type = " + myGlobalType);
console.info("my Global Type prototype = " + myGlobalType.prototype);
console.info("my Global Type constructor = " + myGlobalType.constructor);
console.info("my Global Type show Member info called ");
showMemberInfo(myGlobalType);
console.info("my Global Type show Member info called on prototype");
showMemberInfo(myGlobalType.prototype);
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.