is there any easy way to get the key from the key/value object, if I know the value?
For example I know that value is "red" in these data:
1: 'red',
2: 'blue',
3: 'yellow'
And I want to be able to track number 1 with that. I am looking for the solution without the loops over an object, to be more exact, I would like to know if there is something like the vice-versa solution like this:
var nameOfColor = colors[1];
Or is there no such way? Thanks a lot guys!