Javascript in a browser environment. I wish to get all keys in a JSON object that match a specific pattern. Say, all of them that begin with mystring
. Is there a simpler/efficient way of doing that without having to iterate through all the keys ?
{
somekey1: "someval1",
somekey2: "someval2",
mystringkey1: "someval",
mystringkey2: "someval"
}
There had been similar questions, but a) doesn't fully answer this question and b) JQuery is not an option at the moment.