Implement function switchPlaces
wich takes 3 arguments arr
- array of values, switch1
and switch2
. Values in switch1
and switch2
belong to array arr
. Return new array with values switch1
switch2
switched places.
switchPlaces(['Spider-Man', 'Captain Marvel', 'Hulk'], 'Captain Marvel', 'Hulk')