Merge arrays

    0

    0

    Konrad Psiuk

    The code creates an array of strings and a new set. The new set is a merged copy of the arrays arr1 and arr2.

    //ref: https://youtu.be/bbnkAV12Tig
    const arr1 = ['a','b','c'];
    const arr2 = ['c','d','e'];
    const merged = [...arr1,...arr2];
    const mergedSet = [...new Set([...arr1,...arr2])];
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.