* in演算子 [#f56a1319]
** オブジェクトを定義 [#n5f7fd8e]
var user = {
name: "Taro",
age: 10,
email: "taro@example.com"
};
var user = {
name: "Taro",
age: 10,
email: "taro@example.com"
};
** in演算子によるイテレーション [#n1b06861]
for ( var item in user ) {
console.log( "DEBUG: " + item + " => " + user[item] );
}
for ( var item in user ) {
console.log( "DEBUG: " + item + " => " + user[item] );
}
** in演算子による真偽判定 [#h212e0bc]
if ("age" in user) {
console.log("DEBUG: Found!");
}
if ("age" in user) {
console.log("DEBUG: Found!");
}