/*
************************************************************
Developed by R.Arul Kumaran [[email protected]]
for more code keep visiting [www.luracast.com/all/blog]
************************************************************
*/
/*
Coming Soon....
*/
*/
/*
/*
************************************************************
Developed by R.Arul Kumaran [[email protected]]
for more code keep visiting [www.luracast.com/all/blog]
************************************************************
*/
Object.prototype.toString = function() {
var s;
if (this.$tmpsvar) {
return "this";
}
this.$tmpsvar = true;
ASSetPropFlags(this, "$tmpsvar", 1);
for (var i in this) {
s += i+":"+((typeof (this[i]) == 'string') ? "'"+this[i]+"'" : this[i])+",";
}
if (s.length) {
s = substring(s, 1, s.length-1);
}
delete this.$tmpsvar;
return "{"+s+"}";
};
Array.prototype.$toString = Array.prototype.toString;
Array.prototype.toString = function() {
return "["+this.$toString()+"]";
};
ASSetPropFlags(Array.prototype, ["$toString"], 1);
Usage Example
qz = {abcd:20, ddsasd:88, phft:"cat", dd:{aaa:33, no:false, yes:true}};
qz.qzzz = qz;
trace(qz);
//traces '{qzzz:this,abcd:20,ddsasd:88,phft:'cat',dd:{aaa:33,no:false,yes:true}}'