Write a changeArray function that removes one element from the end of myArray and adds the element passed as function parameters to the beginning of myArray. After all the operations, the changeArray function should return the changed array myArray (we recommend using the pop() and unshift() array methods)
Array Add/Remove elements
Popping and unshifting
Report a typo
Write a program in JavaScript
function changeArray(x){
const myArray = ['John', 'Kate', 'Igor', 'Sam', 'Stan', 'William'];
// write your code here
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.