Append a new element to a given array
Write a JavaScript function to accept 2 parameters, an array and a new value. Append the new value to the given array and return the updated array.
Sample Code:
def appendValue(arr, value):
// Enter your logic here...
Examples:
Input: ['hello','world'], 'hi'
Output: ['hello','world','hi']
Explanation: Add the new value to the end of an given array.
Input: [1,2,3], 4
Output: [1,2,3,4]
Explanation: Add the new value to the end of an given array.