Code Monkey home page Code Monkey logo

array.prototype.findindex's Introduction

Array.prototype.findIndex ES6 polyfill for ES5 versions and lower.

Array.prototype.findIndex ES6 polyfill for ES5 versions and lower via NPM, you only need to require the module in order to have it working in order to use knowing that is going to work in browsers that does not support this function natively.

Build Status - Based from Mozilla polyfill.

Installation.

  1. Require the npm module.
npm install --save-dev jspolyfill-array.prototype.findIndex
  1. Include the file before the usage.

Then you need to require the file on your main.js or where you are going to plan to use the find function as follows:

require("jspolyfill-array.prototype.findIndex")

Usage

arr.findIndex(callback[, thisArg])

Where arr is your array.

  • callback Function to execute on each value in the array, taking three arguments:
    • element The current element being processed in the array.
    • index The index of the current element being processed in the array.
    • array The array findIndex was called upon.
  • thisArg Optional. Object to use as this when executing callback.

The callback passed as a parameter inside of the findIndex function is fired every time per each element inside of the array until finds an element where the callback evaluates to true.

It returns the index of the first match otherwise if no match is found it will return -1.

For more information click here.

array.prototype.findindex's People

Contributors

mitogh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ildaribragimov

array.prototype.findindex's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.