4 ms·
If bar() or fiz() return undefined (i.e. don't return at all), then you will still get the same error as usual undefined is not an object, I reckon.
by eyko 12y ago
If bar() or fiz() return undefined (i.e. don't return at all), then you will still get the same error as usual undefined is not an object, I reckon.
- saraid216 12y agoThe issue isn't that the functions are returning undefined. It's... foo = {} foo.bar() Or, more commonly, foo = {}; bar = 'bar'; foo[bar]();