Given an array and string, update the last element of the array with the string value. Return a new array.
// input:
const a = ['blue', 'red', 'green', 'yellow'], s = 'purple'
// output:
['blue', 'red', 'green', 'purple']
(Ctrl + ')
Loading...
/* output */
Next(Ctrl + y)