I have found some sourcecode on a javascript project but couldn't understand a part of code that looks like this:
keystate= {};
document.addEventListener("keydown", function(event) {
**keystate[event.keyCode] = true;**
});
document.addEventListener("keyup", function(event) {
delete keystate[event.keyCode]
});
The first problem I do not understand is the brackets that come after declaring of the object and then especially what the "= true" means? And a more ambigous question would be: is this a part of OOP (object oriented programming)?