📅  最后修改于: 2022-03-11 15:03:09.188000             🧑  作者: Mango
// We can check if an item or key exists by using a simple if statement.
// We will just provide the key to the if statement.
// If the item or key exists the if block will be executed.
if(dict.name){
console.log(dict.name);
}
if(dict[10]){
console.log(dict[10]);
}