News for hackers. Stuff that matters.
Re:Goodbye “undefined is not a function” by Zarel on Sunday February 22, 2015 @04:03PM (#9091075)
I think "foo.bar is undefined, not a function" might be clearer.
Re:Goodbye “undefined is not a function” by kevan on Sunday February 22, 2015 @06:50PM (#9091793)
This would help a lot in case where you have multiple calls chained together.

    foo.bar().fiz().buz()
What's undefined, bar, fiz, or buz? Then you have to set a breakpoint to find out. Most people I know try to avoid writing code like this, but Knockout ViewModels are a common place where this bites me.
Re:Goodbye “undefined is not a function” by eyko on Sunday February 22, 2015 @08:14PM (#9092034)
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.
Re:Goodbye “undefined is not a function” by saraid216 on Sunday February 22, 2015 @10:11PM (#9092342)
The issue isn't that the functions are returning undefined. It's...

  foo = {}
  foo.bar()
Or, more commonly,

  foo = {};
  bar = 'bar';
  foo[bar]();
Re:Goodbye “undefined is not a function” by schrijver on Sunday February 22, 2015 @04:36PM (#9091226)
Not just clearer, transmits more information!
Re:Goodbye “undefined is not a function” by CmonDev on Monday February 23, 2015 @04:19AM (#9093327)
Even better: "Error, you are using JavaScript."