Coding Interview Question asked in Accenture | Placement Interview question | JavaScript Interview questions
Explanation :-
In JavaScript, arrays are reference types. When we assign let b = a, both a and b refer to the same array in memory.
And, when we modify b[0] = 500, it will reflect the same in a[0], since they both point to the same array.
Thus, output 500,500
#shorts
#javascript
#interview
#youtubeshorts
#coding
#programming
Join us for such kind of Questions with explanation
コメント