GithubHelp home page GithubHelp logo

array-method-challenges's Introduction

Array Methods

Some challenges to practice using arrays and array methods

Array Methods Used

  • .unshift()

    Inserts new elements at the start of an array, and returns the new length of the array.

  • .push()

    Appends new elements to the end of an array, and returns the new length of the array.

  • .shift()

    Removes the FIRST element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

  • .pop()

    Removes the LAST element from an array and returns it. If the array is empty, undefined is returned and the array is not modified.

  • .map()

    Calls a defined callback function on each element of an array, and returns an array that contains the results.

  • .filter()

    Returns the elements of an array that meet the condition specified in a callback function.

  • .sort()

    Sorts an array in place. This method MUTATES the array and returns a reference to the same array.

  • .indexOf()

    Returns the index of the first occurrence of a value in an array, or -1 if it is not present.

  • .slice()

    Returns a copy of a section of an array. For both start and end, a negative index can be used to indicate an offset from the end of the array. For example, -2 refers to the second to last element of the array.

  • .splice()

    Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.

  • .includes()

    Determines whether an array includes a certain element, returning true or false as appropriate.

  • .forEach()

    Performs the specified action for each element in an array.

  • .every()

    Determines whether all the members of an array satisfy the specified test.

  • .find()

    Returns the value of the first element in the array where predicate is true, and undefined otherwise.

  • .reverse()

    Reverses the elements in an array in place. This method MUTATES the array and returns a reference to the same array.

  • .reduce()

    Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.

array-method-challenges's People

Contributors

cglinka95 avatar

Stargazers

 avatar

Watchers

 avatar

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.