instance method Array#every

View source on GitHub →

Array#every([iterator = Prototype.K[, context]]) → Boolean
  • iterator (Function) – An optional function to use to evaluate each element in the enumeration; the function should return the value to test. If this is not provided, the element itself is tested.
  • context (Object) – An optional object to use as this within calls to the iterator.

Determines whether at least one element is truthy (boolean-equivalent to true), either directly or through computation by the provided iterator.

Array#every acts as an ECMAScript 5 polyfill. It is only defined if not already present in the user's browser, and it is meant to behave like the native version as much as possible. Consult the ES5 specification for more information.