(1)先声明,后赋值
var message;
message = 100;
(2)边声明边赋值 var message = “hi”;
(3)一次声明多个变量,中间用逗号隔开
var message = “hi”,found = false,age = 29;
(1)先声明,后赋值
var message;
message = 100;
(2)边声明边赋值 var message = “hi”;
(3)一次声明多个变量,中间用逗号隔开
var message = “hi”,found = false,age = 29;
本文标题:6.变量声明的三种方法
本文链接:https://www.haomeiwen.com/subject/agyyhftx.html
网友评论