Please can someone explain to me what this line of code does:
var list = calls[ev] || (calls[ev] = {});
My best guess:
It\'s setting t
you are right about your first guess. This is a common pattern for initialising javascript namespaces. It serves to make sure you dont overwrite a previous object with the same name. Most popular libraries will do something similar in order to create their namespace objects.
The parenthesis is there so that the expressions are evaluated in the proper order.