Write code to swap the two given numbers.
Hint: You will need to create a new variable
CODE TEMPLATE
let num1 = 20;
let num2 = 30;
// Write your code here
console.log(num1, num2); // should give 30 20
Write code to swap the two given numbers.
Hint: You will need to create a new variable
CODE TEMPLATE
let num1 = 20;
let num2 = 30;
// Write your code here
console.log(num1, num2); // should give 30 20
May you please not post your solution on the comments. We have been kindly told not to do so. Thank you, Amanda
let num1 = 20;
let num2 = 30;
let temp = 20
num1 = num2
num2 = temp
console.log(num1, num2);