var showSingleString=function(str){ var o={}; var ss=str; for(var i=0;i<ss.length;i++){ if(o[ss[i]]===undefined){ o[ss[i]]="daf"; } } return o; }
Define an object, and then pay all the characters to the object as attributes of the object. The attribute values are arbitrary (assign a value only if there are no attributes). In this way, all the attributes of the object are needed, and then these attributes are taken out. Finally Create a new string
-