I am trying to add a property to an object, but Dot notation can't handle a string.
my object:
var lists = {
"Cars":{"Ford":false,"Ferarri":false},
"Names":{"John":true,"Harry":false},
"Homework":{"Maths":true,"Science":false,"History":true,"English":true}
}
Adding a property:
function add_item() {
var input = "Alfa Romeo";
var command = eval('lists.Cars.' + input + '=false');
}
How can I do this using Bracket Notation seeing as it's a 2D object?