Please explain to me what this line of code does:
var list = calls[ev] || (calls[ev] = {});
My best guess:
It sets the variable "list" with the value calls.xxx, where xxx is the variable ev. If the call [ev] does not exist, then it creates it as an empty object and assigns this empty object "list". Is it correct?
Why are parentheses used? Where can I find out more about using || when setting variables and using parentheses in this context? Thanks!
javascript variables fallback
thugsb
source share