这是php代码:
$arr=array(228,184,173,230,150,135,99,104,105,110,101,115,101);
$str='';
foreach ($arr as $i){
$str.=chr($i);
}
print $str;
输出是:中文chinese
这是javascript代码:
var arr=[228,184,173,230,150,135,99,104,105,110,101,115,101];
var str='';
for (i in arr){
str+=String.fromCharCode(arr[i]);
}
console.log(str);
输出是:ä¸æchinese
那么我应该如何在javascript中处理数组呢?