「javaScript入門」in演算子の使用サンプル

JSコード
var oneArr=new Array();
oneArr[“firstKey”]=”data11″;
oneArr[“secondKey”]=”data22″;
var oneObj={};
oneObj.firstKey=”data11″;
oneObj.secondKey=”data22″;
for ( key in oneArr ) {
document.write(key+’=>’+oneArr[key]);
}
for ( key in oneObj ) {
document.write(key+’=>’+oneObj[key]);
}

Comments are closed.