Question 73: Assigning and Updating Variables: Create a function where you declare a variable using let and assign an initial value. Then, update its value within the same function and log both the initial and updated values.
Question 74: Swapping Variables: Demonstrate how to swap the values of two variables. Start with variables a = 5
and b = 10
, then swap their values so that a
becomes 10
and b
becomes 5
.
Question 75: Compound Assignment Operators: Use compound assignment operators to simplify arithmetic operations. Start with x = 4
and perform a series of operations (addition, subtraction, multiplication, division) on x
using compound operators.