How to set value in object in Javascript when you don't know the key pattern?
Example:
Key value is same , but some time it is in CAPITAL or some time it is in lowercase or sometime the first letter is in uppercase and other lowercase.
var a = {
'perm city' :{
value:'asda'
}
}
if((a['perm city'] && a['perm city'].value) || (a['Perm City'] && a['Perm City'].value) || (a['PERM CITY'] && a['PERM CITY'].value)){
a['PERM CITY'] = 'DADASDASD'
}
In my example, I want to set perm city value but I don't know which pattern it will come out.