@@ -635,19 +635,19 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
635635 } ) ;
636636
637637 /**
638- * Returns the index of the first occurrence of a given element .
638+ * Returns a boolean indicating whether an array includes a provided value .
639639 *
640640 * @private
641- * @name indexOf
641+ * @name includes
642642 * @memberof TypedArray.prototype
643643 * @type {Function }
644- * @param {* } searchElement - element to search for
644+ * @param {* } searchElement - search element
645645 * @param {integer } [fromIndex=0] - starting index (inclusive)
646646 * @throws {TypeError } `this` must be a typed array instance
647647 * @throws {TypeError } second argument must be an integer
648- * @returns {integer } index or -1
648+ * @returns {boolean } boolean indicating whether an array includes a provided value
649649 */
650- setReadOnly ( TypedArray . prototype , 'indexOf ' , function indexOf ( searchElement , fromIndex ) {
650+ setReadOnly ( TypedArray . prototype , 'includes ' , function includes ( searchElement , fromIndex ) {
651651 var buf ;
652652 var i ;
653653
@@ -670,26 +670,26 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
670670 buf = this . _buffer ;
671671 for ( i = fromIndex ; i < this . _length ; i ++ ) {
672672 if ( buf [ GETTER ] ( i * BYTES_PER_ELEMENT , this . _isLE ) === searchElement ) {
673- return i ;
673+ return true ;
674674 }
675675 }
676- return - 1 ;
676+ return false ;
677677 } ) ;
678678
679679 /**
680- * Returns a boolean indicating whether an array includes a provided value .
680+ * Returns the index of the first occurrence of a given element .
681681 *
682682 * @private
683- * @name includes
683+ * @name indexOf
684684 * @memberof TypedArray.prototype
685685 * @type {Function }
686- * @param {* } searchElement - search element
686+ * @param {* } searchElement - element to search for
687687 * @param {integer } [fromIndex=0] - starting index (inclusive)
688688 * @throws {TypeError } `this` must be a typed array instance
689689 * @throws {TypeError } second argument must be an integer
690- * @returns {boolean } boolean indicating whether an array includes a provided value
690+ * @returns {integer } index or -1
691691 */
692- setReadOnly ( TypedArray . prototype , 'includes ' , function includes ( searchElement , fromIndex ) {
692+ setReadOnly ( TypedArray . prototype , 'indexOf ' , function indexOf ( searchElement , fromIndex ) {
693693 var buf ;
694694 var i ;
695695
@@ -712,10 +712,10 @@ function factory( dtype ) { // eslint-disable-line max-lines-per-function, stdli
712712 buf = this . _buffer ;
713713 for ( i = fromIndex ; i < this . _length ; i ++ ) {
714714 if ( buf [ GETTER ] ( i * BYTES_PER_ELEMENT , this . _isLE ) === searchElement ) {
715- return true ;
715+ return i ;
716716 }
717717 }
718- return false ;
718+ return - 1 ;
719719 } ) ;
720720
721721 /**
0 commit comments