//这段代码复制下来试一下你就懂了
var a=["Bill","Gate"];
alert("%E4%B8%80%E4%B8%AA%E6%95%B0%E7%BB%84%EF%BC%9A["+a.join(",")+"]");
var b={type:"mytype",value="abc"};
var text="b={";
for(i in b)
{
text+=i;
text+=":\"";
text+=b[i];
text+="\",";
}
text+="}";
alert(text);
[]一般是数组下标,{}是域的范围。