Trait/Object

scala.scalajs.js

JSArrayOps

Related Docs: object JSArrayOps | package js

Permalink

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

Value Members

  1. final def !=(arg0: scala.Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

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

    Permalink
    Implicit information
    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)

    Permalink
    Implicit information
    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

    Permalink
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

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

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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

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

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

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

    Permalink
    Implicit information
    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[_]

    Permalink
    Definition Classes
    AnyRef → Any
  17. def hasOwnProperty(v: String): Boolean

    Permalink

    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

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

    Permalink
    Definition Classes
    Any
  20. def isPrototypeOf(v: Object): Boolean

    Permalink

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

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

    Permalink

    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" )
  23. def jsFilter(callbackfn: Function1[A, Boolean]): Array[A]

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

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

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

    Permalink

    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" )
  27. def jsForEach(callbackfn: Function1[A, _]): Unit

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

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

    Permalink
    Annotations
    @JSName( name = "forEach" )
  30. def jsForEach[T](callbackfn: ThisFunction3[T, A, Int, Array[A], _], thisArg: T): Unit

    Permalink

    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" )
  31. def jsIndexOf(searchElement: A): Int

    Permalink
    Annotations
    @JSName( name = "indexOf" )
  32. def jsIndexOf(searchElement: A, fromIndex: Int): Int

    Permalink

    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" )
  33. def jsLastIndexOf(searchElement: A): Int

    Permalink
    Annotations
    @JSName( name = "lastIndexOf" )
  34. def jsLastIndexOf(searchElement: A, fromIndex: Int): Int

    Permalink

    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" )
  35. def jsMap[B](callbackfn: Function1[A, B]): Array[B]

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

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

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

    Permalink

    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" )
  39. def jsReduce[B](callbackfn: Function2[B, A, B]): B

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

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

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

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

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

    Permalink

    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" )
  45. def jsReduceRight[B](callbackfn: Function2[B, A, B]): B

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

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

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

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

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

    Permalink

    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" )
  51. def jsSome(callbackfn: Function1[A, Boolean]): Boolean

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

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

    Permalink
    Annotations
    @JSName( name = "some" )
  54. def jsSome[T](callbackfn: ThisFunction3[T, A, Int, Array[A], Boolean], thisArg: T): Boolean

    Permalink

    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" )
  55. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  56. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  57. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  58. def propertyIsEnumerable(v: String): Boolean

    Permalink

    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
  59. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  60. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  61. def toString(): String

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

    Permalink
    Definition Classes
    Object
  63. final def wait(): Unit

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

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

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

    Permalink
    Implicit information
    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