Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Js How many bytes does a var variable occupy?
Js How many bytes does a var variable occupy?
Not necessarily/possibly

The var variable of js is actually not a variable type, but represents type derivation.

For example, var a = 0;;

Js will judge for itself that the value you assigned to it is 0, and then decide to save the A variable with int type, which is 4 bytes at this time.

If var b = "123456";

Then js will decide to store B with a string, which will take up a lot of memory.