javascriptバージョンtoString

505 ワード


//  object "   :   "     
function objToString(object)
{
   var attrStr="";
   for(attr in object)
   {
      if(object.hasOwnProperty(attr))
      {
         var valueOfAttr="object['"+attr+"']";
       attrStr=attrStr+attr+":"+eval(valueOfAttr)+",";
      }
   }
   attrStr=attrStr.slice(0,attrStr.length-1);
   return attrStr;
}