Skip to main content

Command Palette

Search for a command to run...

May 17 Codewar

Updated
•1 min read•View as Markdown
A

Mom of two munchkins and a crochet enthusiast. Mexican-American. Navigating through the tech world. Learning new things every day. Taking it one day at a time.

This codewar I saw and I kinda knew what it needed from me. I did my googling and found a few methods to work with it but in the end I was not able to finish it after 20min of going around it. I saw other solutions using the .reduce method and I honestly forgot all about that.

my attempt:

function arrayPlusArray(arr1, arr2) {
    const newarray = arr1.concat(arr2);
     //console.log(newarray)<<<< this worked
     return newarray.forEach(e => e + e)
     //trying to do a forEach of the new array and add them together but I think I went wrong making them into a string...?

Like I said I need to review more of the methods and get comfortable using them all.