var num1 = 10;
和
var num1 = “10”;
有什么区别?
var num1 = 10; and var num1 = “10”; What is the difference? -PHP Chinese website Q&A-What is the difference between var num1 = 10; and var num1 = “10”;? -PHP Chinese website Q&A
Please watch and learn.
没用引号 var num1 = 10 是一个int类型的值
用了引号 var num1 = “10” 是字符串类型的值
num1=10 是值num1="10" 字符串
你声明的变量var num1=10;里的10是number也就是数字,而var num='10'里的10是字符串,
你可以尝试下num2=num1+num1;前一个得出的是20,后面一个得出的是1010
var num1 = 10; and var num1 = “10”; What is the difference? -PHP Chinese website Q&A-What is the difference between var num1 = 10; and var num1 = “10”;? -PHP Chinese website Q&A
Please watch and learn.
没用引号 var num1 = 10 是一个int类型的值
用了引号 var num1 = “10” 是字符串类型的值
num1=10 是值
num1="10" 字符串
你声明的变量var num1=10;里的10是number也就是数字,而var num='10'里的10是字符串,
你可以尝试下num2=num1+num1;前一个得出的是20,后面一个得出的是1010