Python
dict = { 'platform': 'telegram' }
if 'platform' in dict:
# do something
Enter fullscreen mode Exit fullscreen mode
Javascript
let obj ={ platform: 'telegram' }
if(obj['platform']){
// do something
}
Enter fullscreen mode Exit fullscreen mode
原文链接:Check if key exists in Dictionary/Object in Python vs Javascript
© 版权声明
THE END
暂无评论内容