0

Consider this JS code:

var name = "jack";

console.log(typeof name);
//'string'

name = {age: 40};

console.log(typeof name);
//'string'

Why does changing the variable does not change its type?

Alexander Nied
  • 12,804
  • 4
  • 25
  • 45
jumpo marketing
  • 477
  • 1
  • 6
  • 12

0 Answers0