Check if key exists in Dictionary/Object in Python vs Javascript

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
喜欢就支持一下吧
点赞8 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容