DEV Community

VICTOR OMONDI
VICTOR OMONDI

Posted on

2 1

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

Top comments (1)

Collapse
 
waylonwalker profile image
Waylon Walker

❤️ python

SurveyJS custom survey software

JavaScript UI Libraries for Surveys and Forms

SurveyJS lets you build a JSON-based form management system that integrates with any backend, giving you full control over your data and no user limits. Includes support for custom question types, skip logic, integrated CCS editor, PDF export, real-time analytics & more.

Learn more