scala.scalajs.js

JSArrayOps

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() @deprecated @native()
Deprecated

(Since version 0.6.25)

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 any2stringfmt
  3. by any2ArrowAssoc
  4. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: scala.Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  5. def ->[B](y: B): (JSArrayOps[A], B)

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  6. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. final def ==(arg0: scala.Any): Boolean

    Definition Classes
    Any
  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. def ensuring(cond: (JSArrayOps[A]) ⇒ Boolean, msg: ⇒ scala.Any): JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: (JSArrayOps[A]) ⇒ Boolean): JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean, msg: ⇒ scala.Any): JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. def ensuring(cond: Boolean): JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. def equals(arg0: scala.Any): Boolean

    Definition Classes
    AnyRef → Any
  16. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  17. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  18. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  19. 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
  20. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. 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
  23. def jsEvery(callbackfn: Function3[A, Int, Array[A], Boolean]): Boolean

    Annotations
    @JSName( name = "every" )
  24. 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" )
  25. def jsFilter(callbackfn: Function1[A, Boolean]): Array[A]

    Annotations
    @JSName( name = "filter" )
  26. def jsFilter(callbackfn: Function2[A, Int, Boolean]): Array[A]

    Annotations
    @JSName( name = "filter" )
  27. def jsFilter(callbackfn: Function3[A, Int, Array[A], Boolean]): Array[A]

    Annotations
    @JSName( name = "filter" )
  28. 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" )
  29. def jsForEach(callbackfn: Function1[A, _]): Unit

    Annotations
    @JSName( name = "forEach" )
  30. def jsForEach(callbackfn: Function2[A, Int, _]): Unit

    Annotations
    @JSName( name = "forEach" )
  31. def jsForEach(callbackfn: Function3[A, Int, Array[A], _]): Unit

    Annotations
    @JSName( name = "forEach" )
  32. 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" )
  33. def jsIndexOf(searchElement: A): Int

    Annotations
    @JSName( name = "indexOf" )
  34. 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" )
  35. def jsLastIndexOf(searchElement: A): Int

    Annotations
    @JSName( name = "lastIndexOf" )
  36. 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" )
  37. def jsMap[B](callbackfn: Function1[A, B]): Array[B]

    Annotations
    @JSName( name = "map" )
  38. def jsMap[B](callbackfn: Function2[A, Int, B]): Array[B]

    Annotations
    @JSName( name = "map" )
  39. def jsMap[B](callbackfn: Function3[A, Int, Array[A], B]): Array[B]

    Annotations
    @JSName( name = "map" )
  40. 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" )
  41. def jsReduce[B](callbackfn: Function2[B, A, B]): B

    Annotations
    @JSName( name = "reduce" )
  42. def jsReduce[B](callbackfn: Function3[B, A, Int, B]): B

    Annotations
    @JSName( name = "reduce" )
  43. def jsReduce[B](callbackfn: Function4[B, A, Int, Array[A], B]): B

    Annotations
    @JSName( name = "reduce" )
  44. def jsReduce[B](callbackfn: Function2[B, A, B], initialValue: B): B

    Annotations
    @JSName( name = "reduce" )
  45. def jsReduce[B](callbackfn: Function3[B, A, Int, B], initialValue: B): B

    Annotations
    @JSName( name = "reduce" )
  46. 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" )
  47. def jsReduceRight[B](callbackfn: Function2[B, A, B]): B

    Annotations
    @JSName( name = "reduceRight" )
  48. def jsReduceRight[B](callbackfn: Function3[B, A, Int, B]): B

    Annotations
    @JSName( name = "reduceRight" )
  49. def jsReduceRight[B](callbackfn: Function4[B, A, Int, Array[A], B]): B

    Annotations
    @JSName( name = "reduceRight" )
  50. def jsReduceRight[B](callbackfn: Function2[B, A, B], initialValue: B): B

    Annotations
    @JSName( name = "reduceRight" )
  51. def jsReduceRight[B](callbackfn: Function3[B, A, Int, B], initialValue: B): B

    Annotations
    @JSName( name = "reduceRight" )
  52. 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" )
  53. def jsSome(callbackfn: Function1[A, Boolean]): Boolean

    Annotations
    @JSName( name = "some" )
  54. def jsSome(callbackfn: Function2[A, Int, Boolean]): Boolean

    Annotations
    @JSName( name = "some" )
  55. def jsSome(callbackfn: Function3[A, Int, Array[A], Boolean]): Boolean

    Annotations
    @JSName( name = "some" )
  56. 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" )
  57. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  58. final def notify(): Unit

    Definition Classes
    AnyRef
  59. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  60. 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
  61. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  62. def toLocaleString(): String

    Definition Classes
    Object
  63. def toString(): String

    Definition Classes
    AnyRef → Any
  64. def valueOf(): scala.Any

    Definition Classes
    Object
  65. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  66. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  67. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  68. def [B](y: B): (JSArrayOps[A], B)

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: scala.Any

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to StringAdd performed by method any2stringadd in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (jSArrayOps: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: scala.Any

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to StringFormat performed by method any2stringfmt in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (jSArrayOps: StringFormat).self
    Definition Classes
    StringFormat

Deprecated Value Members

  1. def x: JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to ArrowAssoc[JSArrayOps[A]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (jSArrayOps: ArrowAssoc[JSArrayOps[A]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: JSArrayOps[A]

    Implicit information
    This member is added by an implicit conversion from JSArrayOps[A] to Ensuring[JSArrayOps[A]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (jSArrayOps: Ensuring[JSArrayOps[A]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from scala.Any

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

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

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

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

Ungrouped