Array.prototype.concatbeginnerconst arr = [1, 2, 3]
arr.concat(4) // β [1, 2, 3, 4]
arr.concat(4, 5) // β [1, 2, 3, 4, 5]Use concat() to append individual values to an array, returning a new array.
concat() also accepts non-array values and simply appends them as elements.
Challenge: Implement appendValue(arr, val) that returns a new array with val appended, using .concat(val).
appendValue([1, 2, 3], 4) // β [1, 2, 3, 4]
appendValue([], 'hello') // β ['hello']