在JavaScript中,变量是动态的 。这意味着他们可以在给定时间保存数字,字符串或任何其他数据类型。要声明一个字符串,只需初始化 (创建)一个变量:
var a;
然后,使用单引号或双引号,声明字符串:
a = "Hello Camper!";