Packages

trait JSArrayOps[A] extends Object

Discouraged native JavaScript Array methods.

In general, you should prefer the Scala collection methods available implicitly through ArrayOps, because they are inlineable, and hence faster.

To enable the use of these functions on js.Arrays, import the implicit conversion JSArrayOps.jsArrayOps.

Annotations
@RawJSType()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. JSArrayOps
  2. Object
  3. Any
  4. AnyRef
  5. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def jsEvery(callbackfn: Function3[A, Int, Array[A], Boolean]): Boolean
    Annotations
    @JSName( name = "every" )
  2. abstract def jsEvery[T](callbackfn: ThisFunction3[T, A, Int, Array[A], Boolean], thisArg: T): Boolean

    The every method executes the provided callback function once for each element present in the array until it finds one where callback returns a falsy value (a value that becomes false when converted to a Boolean).

    The every method executes the provided callback function once for each element present in the array until it finds one where callback returns a falsy value (a value that becomes false when converted to a Boolean). If such an element is found, the every method immediately returns false. Otherwise, if callback returned a true value for all elements, every will return true. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.

    callback is invoked with three arguments:

    - the value of the element - the index of the element - and the Array object being traversed.

    If a thisObject parameter is provided to every, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead.

    every does not mutate the array on which it is called.

    every acts like the "for all" quantifier in mathematics. In particular, for an empty array, it returns true. (It is vacuously true that all elements of the empty set satisfy any given condition.)

    MDN

    Annotations
    @JSName( name = "every" )
  3. abstract def jsFilter(callbackfn: Function1[A, Boolean]): Array[A]
    Annotations
    @JSName( name = "filter" )
  4. abstract def jsFilter(callbackfn: Function2[A, Int, Boolean]): Array[A]
    Annotations
    @JSName( name = "filter" )
  5. abstract def jsFilter(callbackfn: Function3[A, Int, Array[A], Boolean]): Array[A]
    Annotations
    @JSName( name = "filter" )
  6. abstract def jsFilter[T](callbackfn: ThisFunction3[T, A, Int, Array[A], Boolean], thisArg: T): Array[A]

    filter calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a true value.

    filter calls a provided callback function once for each element in an array, and constructs a new array of all the values for which callback returns a true value. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values. Array elements which do not pass the callback test are simply skipped, and are not included in the new array.

    callback is invoked with three arguments:

    - the value of the element - the index of the element - the Array object being traversed

    If a thisObject parameter is provided to filter, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead.

    filter does not mutate the array on which it is called.

    MDN

    Annotations
    @JSName( name = "filter" )
  7. abstract def jsForEach(callbackfn: Function1[A, _]): Unit
    Annotations
    @JSName( name = "forEach" )
  8. abstract def jsForEach(callbackfn: Function2[A, Int, _]): Unit
    Annotations
    @JSName( name = "forEach" )
  9. abstract def jsForEach(callbackfn: Function3[A, Int, Array[A], _]): Unit
    Annotations
    @JSName( name = "forEach" )
  10. abstract def jsForEach[T](callbackfn: ThisFunction3[T, A, Int, Array[A], _], thisArg: T): Unit

    forEach executes the provided callback once for each element of the array with an assigned value.

    forEach executes the provided callback once for each element of the array with an assigned value. It is not invoked for indexes which have been deleted or which have been initialized to undefined.

    callback is invoked with three arguments:

    - the element value - the element index - the array being traversed

    If a thisArg parameter is provided to forEach, it will be used as the this value for each callback invocation as if callback.call(thisArg, element, index, array) was called. If thisArg is undefined or null, the this value within the function depends on whether the function is in strict mode or not (passed value if in strict mode, global object if in non-strict mode).

    MDN

    Annotations
    @JSName( name = "forEach" )
  11. abstract def jsIndexOf(searchElement: A): Int
    Annotations
    @JSName( name = "indexOf" )
  12. abstract def jsIndexOf(searchElement: A, fromIndex: Int): Int

    The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.

    The indexOf() method returns the first index at which a given element can be found in the array, or -1 if it is not present.

    MDN

    Annotations
    @JSName( name = "indexOf" )
  13. abstract def jsLastIndexOf(searchElement: A): Int
    Annotations
    @JSName( name = "lastIndexOf" )
  14. abstract def jsLastIndexOf(searchElement: A, fromIndex: Int): Int

    The lastIndexOf() method returns the last index at which a given element can be found in the array, or -1 if it is not present.

    The lastIndexOf() method returns the last index at which a given element can be found in the array, or -1 if it is not present. The array is searched backwards, starting at fromIndex.

    MDN

    Annotations
    @JSName( name = "lastIndexOf" )
  15. abstract def jsMap[B](callbackfn: Function1[A, B]): Array[B]
    Annotations
    @JSName( name = "map" )
  16. abstract def jsMap[B](callbackfn: Function2[A, Int, B]): Array[B]
    Annotations
    @JSName( name = "map" )
  17. abstract def jsMap[B](callbackfn: Function3[A, Int, Array[A], B]): Array[B]
    Annotations
    @JSName( name = "map" )
  18. abstract def jsMap[B, T](callbackfn: ThisFunction3[T, A, Int, Array[A], B], thisArg: T): Array[B]

    map calls a provided callback function once for each element in an array, in order, and constructs a new array from the results.

    map calls a provided callback function once for each element in an array, in order, and constructs a new array from the results. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.

    callback is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

    If a thisArg parameter is provided to map, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead.

    map does not mutate the array on which it is called.

    MDN

    Annotations
    @JSName( name = "map" )
  19. abstract def jsReduce[B](callbackfn: Function2[B, A, B]): B
    Annotations
    @JSName( name = "reduce" )
  20. abstract def jsReduce[B](callbackfn: Function3[B, A, Int, B]): B
    Annotations
    @JSName( name = "reduce" )
  21. abstract def jsReduce[B](callbackfn: Function4[B, A, Int, Array[A], B]): B
    Annotations
    @JSName( name = "reduce" )
  22. abstract def jsReduce[B](callbackfn: Function2[B, A, B], initialValue: B): B
    Annotations
    @JSName( name = "reduce" )
  23. abstract def jsReduce[B](callbackfn: Function3[B, A, Int, B], initialValue: B): B
    Annotations
    @JSName( name = "reduce" )
  24. abstract def jsReduce[B](callbackfn: Function4[B, A, Int, Array[A], B], initialValue: B): B

    reduce executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.

    reduce executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.

    The first time the callback is called, previousValue and currentValue can be one of two values. If initialValue is provided in the call to reduce, then previousValue will be equal to initialValue and currentValue will be equal to the first value in the array. If no initialValue was provided, then previousValue will be equal to the first value in the array and currentValue will be equal to the second.

    MDN

    Annotations
    @JSName( name = "reduce" )
  25. abstract def jsReduceRight[B](callbackfn: Function2[B, A, B]): B
    Annotations
    @JSName( name = "reduceRight" )
  26. abstract def jsReduceRight[B](callbackfn: Function3[B, A, Int, B]): B
    Annotations
    @JSName( name = "reduceRight" )
  27. abstract def jsReduceRight[B](callbackfn: Function4[B, A, Int, Array[A], B]): B
    Annotations
    @JSName( name = "reduceRight" )
  28. abstract def jsReduceRight[B](callbackfn: Function2[B, A, B], initialValue: B): B
    Annotations
    @JSName( name = "reduceRight" )
  29. abstract def jsReduceRight[B](callbackfn: Function3[B, A, Int, B], initialValue: B): B
    Annotations
    @JSName( name = "reduceRight" )
  30. abstract def jsReduceRight[B](callbackfn: Function4[B, A, Int, Array[A], B], initialValue: B): B

    reduceRight executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.

    reduceRight executes the callback function once for each element present in the array, excluding holes in the array, receiving four arguments: the initial value (or value from the previous callback call), the value of the current element, the current index, and the array over which iteration is occurring.

    MDN

    Annotations
    @JSName( name = "reduceRight" )
  31. abstract def jsSome(callbackfn: Function1[A, Boolean]): Boolean
    Annotations
    @JSName( name = "some" )
  32. abstract def jsSome(callbackfn: Function2[A, Int, Boolean]): Boolean
    Annotations
    @JSName( name = "some" )
  33. abstract def jsSome(callbackfn: Function3[A, Int, Array[A], Boolean]): Boolean
    Annotations
    @JSName( name = "some" )
  34. abstract def jsSome[T](callbackfn: ThisFunction3[T, A, Int, Array[A], Boolean], thisArg: T): Boolean

    some executes the callback function once for each element present in the array until it finds one where callback returns a true value.

    some executes the callback function once for each element present in the array until it finds one where callback returns a true value. If such an element is found, some immediately returns true. Otherwise, some returns false. callback is invoked only for indexes of the array which have assigned values; it is not invoked for indexes which have been deleted or which have never been assigned values.

    callback is invoked with three arguments: the value of the element, the index of the element, and the Array object being traversed.

    If a thisObject parameter is provided to some, it will be used as the this for each invocation of the callback. If it is not provided, or is null, the global object associated with callback is used instead.

    some does not mutate the array on which it is called.

    MDN

    Annotations
    @JSName( name = "some" )

Concrete Value Members

  1. final def !=(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to any2stringadd[JSArrayOps[A]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (JSArrayOps[A], B)
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (JSArrayOps[A]) ⇒ Boolean, msg: ⇒ scala.Any): JSArrayOps[A]
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (JSArrayOps[A]) ⇒ Boolean): JSArrayOps[A]
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ scala.Any): JSArrayOps[A]
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): JSArrayOps[A]
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: scala.Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to StringFormat[JSArrayOps[A]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  16. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  17. def hasOwnProperty(v: String): Boolean

    Tests whether this object has the specified property as a direct property.

    Tests whether this object has the specified property as a direct property.

    Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.

    MDN

    Definition Classes
    Object
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    Tests whether this object is in the prototype chain of another object.

    Tests whether this object is in the prototype chain of another object.

    Definition Classes
    Object
  21. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. final def notify(): Unit
    Definition Classes
    AnyRef
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  24. def propertyIsEnumerable(v: String): Boolean

    Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.

    Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain. If the object does not have the specified property, this method returns false.

    MDN

    Definition Classes
    Object
  25. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  26. def toLocaleString(): String
    Definition Classes
    Object
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. def valueOf(): scala.Any
    Definition Classes
    Object
  29. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. def [B](y: B): (JSArrayOps[A], B)
    Implicit
    This member is added by an implicit conversion from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

Inherited by implicit conversion any2stringadd from JSArrayOps[A] to any2stringadd[JSArrayOps[A]]

Inherited by implicit conversion StringFormat from JSArrayOps[A] to StringFormat[JSArrayOps[A]]

Inherited by implicit conversion Ensuring from JSArrayOps[A] to Ensuring[JSArrayOps[A]]

Inherited by implicit conversion ArrowAssoc from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]]

Ungrouped