标签:ar java sp bs new as javascript nbsp 字符串
1、var s = "this is a string";
var t = "this is also a string";
s.test = 20;
2、var s = new String("this is a string");
var t = new String("this is also a string");
s.test = 20;
这两种方式有何区别?
第一种方式定义的test为s、t以及将来的所用此种形式定义的字符串定义了test.
第二种方式定义的test仅为s定义.
标签:ar java sp bs new as javascript nbsp 字符串
原文地址:http://www.cnblogs.com/fantasy01/p/4070330.html