Javascript
Apr 19, 2026
What does this output?
let a = 1
let b = a
b = 99
console.log(a)
Explanation
Primitives are copied by value. b = a creates an independent copy.
📝
Reviewed by CodeShot Editorial
Every challenge is code-reviewed by senior developers to ensure accuracy and real-world relevance. Learn more.