I'm trying to access a JSON using a variable I'm passing through a function:
function highlightCategory (category) {
   for (var i in data) {
      console.log(data[i].category)
   }
}
Obviously, this doesn't work, because 'category' is what I'm passing with the function and not the real name of the property, but I've been trying different possibilities unsuccessfully. Thanks in advance!
console.log(data[category])