Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

119
Views
In operator returns true in a property not present in an object

This is a snippet of code of code in QML Itme which is supposed to be using straight up JavaScript. However I cannot, for the life of me, figure out what is going on.

    let item =  itemList.get(vmCurrentIndex); // itemList is a ModelList
    console.log(JSON.stringify(item));
    console.log(("vmMetadata" in item));
    console.log(("vmIndex" in item));
    console.log(("vmText" in item));
    console.log(("hasMouse" in item));
    console.log(("something" in item));
    console.log(("or" in item));
    console.log(("other" in item));

The output of the tests above are:

qml: {"vmText":"No protocol","vmIndex":0,"hasMouse":false}
qml: true
qml: true
qml: true
qml: true
qml: true
qml: true
qml: true

Which makes no sense. only vmIndex, vmText and hasMouse are in item, everything else should have returned false. How is this possible? If I can't use the in operator how can I test if a key is present in a javascript object?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!