Imagine a scenario where we have a type
or interface
defined as NumberLookupCriteria
:
type NumberLookupCriteria = {
dialCode: string;
phoneNumber: string;
}
or
interface NumberLookupCriteria {
dialCode: string;
phoneNumber: string;
}
Is there a way to extract all the keys
from this structure and store them in a JavaScript array like this:
const keys = ['dialCode','phoneNumber']
Any suggestions on how to achieve this?