repl.it
@Tyledelphia/

addToBackOfNew

JavaScript

No description

fork
loading
main.js
1
2
3
4
5
6
7
8
9
var input = [1, 2];

function addToBackOfNew(arr, element) {
   arr.slice();
   newArr.push(element);
   return newArr;
}

addToBackOfNew(input, 3);
Native Browser JavaScript