On 11:59 AM, Kyle Simpson wrote:
Brendan, you've asked for other coding examples where I use the
pattern of some variable being `undefined` or not to trigger different
behavior (that is, to use the variable or not). Here's two more:
Here are some examples from Firebug code:
Lazy object construction. A pervasive pattern in our code.
if (!context.eventsMonitored)
context.eventsMonitored = [];
Temp introduced because `undefined` come at depth:
var htmlPanel = context.getPanel("html", true);
var vars = htmlPanel ? htmlPanel.getInspectorVars() : null;
Another `undefined` at depth
(state ? state.wasScrolledToBottom : "no prev state")
jjb
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss