How do I swap the values of my function?
AndresHaro1 (2)

function roadRage() {
let rightLane = "Chevy";
let leftLane = "Honda";

//Write your code here to make the cars switch lanes
let Chevy = leftLane;
let Honda = rightLane;
return (`That ${rightLane} and ${leftLane} won't pick a lane`)



You are viewing a single comment. View All
Vandesm14 (1636)

In the repl:
I have created a function swapLanes() which takes the right and left lanes and returns them as an array. This array is then used to reverse the order of the cars by using the index of the leftLane and storing it to the rightLane and same for the other.

Please mark this as answered if I helped your problem 👍