Adding and removing in the array
Given both an array and input, remove the first element of the array and insert the input to the end of the array.
Sample Code:
function addRmv(arr,inp) {
// Enter your logic here...
}
Examples:
Input: [1,2,3],4
Output: [2,3,4]
Explanation: 4 has been added to the end of the array and 1 has been removed..
Input: [' ',true,100],[0,1]
Output: [true,100,[0,1]]
Explanation: [0,1] has been added to the end of the array and ' ' has been removed.