how to access a property of an object, if the property name is not fully known?

How to access a property of a javascript object if property name is not fully known? Need to access value by knowing that “totalCount” will be part of property name. Sample :

[
  {"totalCount_12":100},
  {"totalCount_13":100},
  {"totalCount_2":100}
]

Answer

I hope this piece of code will help you

a = {"totalCount_12":100}
a[Object.keys(a).filter(i=>i.includes("totalCount"))[0]]