Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson

Already subscribed? Sign In

Autoplay

    Add and Remove Array Items with JavaScript concat() and slice() to Avoid Mutation

    Erik AybarErik Aybar

    In this video we'll learn how to perform common add and remove array operations such as append, prepend, insert, and remove. We'll look at the dangers of mutation that can be caused by using mutative array methods such as Array.prototype.push and learn how to instead leverage non-mutative array methods such as Array.prototype.concat and Array.prototype.slice when working with arrays.

    javascriptJavaScript
    Code

    Code

    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson
    Discuss

    Discuss