@@ -771,11 +771,19 @@ Object.extend(String.prototype, (function() {
771
771
772
772
/**
773
773
* String#startsWith(substring[, position]) -> Boolean
774
- * - substring (String): The characters to be searched for at the start of this string.
775
- * - [position] (Number): The position in this string at which to begin searching for `substring`; defaults to 0.
774
+ * - substring (String): The characters to be searched for at the start of
775
+ * this string.
776
+ * - [position] (Number): The position in this string at which to begin
777
+ * searching for `substring`; defaults to 0.
776
778
*
777
779
* Checks if the string starts with `substring`.
778
780
*
781
+ * `String#startsWith` acts as an ECMAScript 6 [polyfill](http://remysharp.com/2010/10/08/what-is-a-polyfill/).
782
+ * It is only defined if not already present in the user's browser, and it
783
+ * is meant to behave like the native version as much as possible. Consult
784
+ * the [ES6 specification](http://wiki.ecmascript.org/doku.php?id=harmony%3Aspecification_drafts) for more
785
+ * information.
786
+ *
779
787
* ##### Example
780
788
*
781
789
* 'Prototype JavaScript'.startsWith('Pro');
@@ -792,12 +800,20 @@ Object.extend(String.prototype, (function() {
792
800
793
801
/**
794
802
* String#endsWith(substring[, position]) -> Boolean
795
- * - substring (String): The characters to be searched for at the end of this string.
796
- * - [position] (Number): Search within this string as if this string were only this long;
797
- * defaults to this string's actual length, clamped within the range established by this string's length.
803
+ * - substring (String): The characters to be searched for at the end of
804
+ * this string.
805
+ * - [position] (Number): Search within this string as if this string were
806
+ * only this long; defaults to this string's actual length, clamped
807
+ * within the range established by this string's length.
798
808
*
799
809
* Checks if the string ends with `substring`.
800
810
*
811
+ * `String#endsWith` acts as an ECMAScript 6 [polyfill](http://remysharp.com/2010/10/08/what-is-a-polyfill/).
812
+ * It is only defined if not already present in the user's browser, and it
813
+ * is meant to behave like the native version as much as possible. Consult
814
+ * the [ES6 specification](http://wiki.ecmascript.org/doku.php?id=harmony%3Aspecification_drafts) for more
815
+ * information.
816
+ *
801
817
* ##### Example
802
818
*
803
819
* 'slaughter'.endsWith('laughter')
0 commit comments