What will be the output of this code? #javascript

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

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

Both will remain 0 as its a post increment so the value 0 will be assinged also user2 is using the same reference as user1 hence both share the same memory ref and thats why both will have 0

SatyamSingh-rpby
Автор

0 0 if not post increment i mean +1 than 1 1

rohithv
Автор

First 0 as we didn't change its value, then second is 1 as we have assigned a value to it. Pass by value. I don't know javascript, guessed it based on my c knowledge, am I right ?

MrSakumar
Автор

0, 0 since const can't be changed🤔

yogeshmali
join shbcf.ru