In Typescript
i need the object in key but in my case, i need the specific key like key is jonnny so i find the last word nny to find this key so it possible to find this key and this is only one key this type so how to find this key please help and give me the best way and short using build function
I found all the articles but did not get this type of information
2
Answers
Object.keys()
will get you a list of keys, and.find()
will pull the first matching item from a list, so you could writeI think the first answer gets it mostly correct, except if you’re looking to find a key that ends with something you’d use
endsWith
–EDIT
If you want an exclusion/"not using" based logic, here’s an example –