andrewplummer/Sugar — Issue #88: String#startsWith() problems with non string parameter
Author: OmarIthawi
Created: 2012-01-09 18:30:48+00:00
State: open

Thanks to firebug I've seen this issue in startsWith(undefined).
My use case is:

var d = $(this).data('property'); // jQuery
var yes = 'mystring'.startsWith(d);

But d were `undefined`, and error were thrown. IMO this is not the best behavior. `return false` would be a lot better.
Also this `'10. hello world'.startsWith(10)` fails. Converting `Number`s to `String`s would be very useful.

Thanks you for the awesome lib.