I wanted to find the key in object with case insensitive.
Object is very large, so I can not modify the object to make all the keys in lowercase/uppercase.
For example.
I have var _columns = {...}
Now I need to find whether Id key exists in it or not.
Currently i am using if else to solve this problem.
if (this._columns['Id']) {
this._idColumnName = 'Id';
} else if (this._columns['id']) {
this._idColumnName = 'id';
} else if (this._columns['ID']) {
this._idColumnName = 'ID';
}
S is there any way to check the presence of key by using any pattern or any other way in JavaScript.