We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
2
Look for recent answers in this thread. In 'modern' javascript, consider using the in operator:'key' in obj ? 'obj has key property' : 'obj does not have key property' `
I’m open to picking a new ‘correct’ answer if you have one in mind that covers the old way as completely as the current one and also addresses more modern options.
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
complete the sentence: my question is about...
use tags that describe things or concepts that are essential, not incidental to your question
inoperator:'key' in obj ? 'obj has key property' : 'obj does not have key property'`