Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Is the number a string by default?
Is the number a string by default?
No, numbers are displayed as strings.

In the language that implements js engine, number is the most basic type, but string is not. The storage structure level of strings is higher than numbers. Although both numbers and character strings belong to the basic types in js, in the implementation of js engine itself, the storage levels of int, long and char are different, and their characteristics and operation methods are also different. In js, the number object does not provide a method of string. If you want to use it, you must first explicitly convert the type to a string.

123456' This is a string; 1',' 2', which is a character; Int i= 10, which is a numerical type (shaping).