JavaScript Interview Question: Swap Two Variables #programming #code

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

I knew it!
I knew that was how you did it, But I never had the need to swap variables. 😅

a.j.outlaster
Автор

hello this works ? 👇🏼
temp = a
a = b
b = temp

The_BEN_Youtube
Автор

How setup your editor??
Upper your editor and down chrome console??
How

s.m.ahadalichowdhury
Автор

Let c = a
a = b
b = c

Think of it's like you have two Buckets
One has water in it
One has sand in it
So to swap between both
You will need a third Bucket to do it

Sorry for my perfect English,
But u can get the idea!

Abdallah_Ismail
Автор

In other languages another variable would’ve allowed the swap

a = b
b = a
a = c

crallo_phades
visit shbcf.ru