-
Bug
-
Resolution: Fixed
-
Major
-
3.5
-
None
In fact it works only in Firefox.
In chrome console : Uncaught TypeError: Object index has no method 'startsWith'
Javascript does not define startsWith (as well endsWith and contains), but Firefox implements it MDN ref
ECMAScript Harmony (ES6, still in development) has only made a proposal for those methods.
Best workaround I am aware of is :
if (typeof String.prototype.startsWith != 'function') { String.prototype.startsWith = function (str){ return this.lastIndexOf(str, 0) === 0 }; }