Swap Two Values
Swap Two Values
Two server variables need to trade values. This is a common reassignment pattern: save one value temporarily before it gets overwritten.
Your task: Swap primaryServer and backupServer without typing either server name as a string again. Log the new primary server, then the new backup server.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Swap Two Values
Two server variables need to trade values. This is a common reassignment pattern: save one value temporarily before it gets overwritten.
Your task: Swap primaryServer and backupServer without typing either server name as a string again. Log the new primary server, then the new backup server.