Merge arrays



    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.

    const arr1 = ['a','b','c'];
    const arr2 = ['c','d','e'];
    const merged = [...arr1,...arr2];
    const mergedSet = [ 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.