首页 > 其他 > 详细

简单类型对象 String

时间:2016-01-28 10:33:41      阅读:167      评论:0      收藏:0      [点我收藏+]
简单值不是对象,因此也没有属性方法,因此运行下面代码时
 
var s1 = “some text”;
var s2 = s1.substring(2);
 
实际上是运行在read模式,字符串的值会被直接从内存读取,会触发如下步骤
 
- Create an instance of the String type(new String())
 
- Call the specified method on the instance
 
- Destroy the instance

因此在字符串,数字,布尔值上调用方法都会按上面步骤执行

简单类型对象 String

原文:http://www.cnblogs.com/chuangweili/p/5165260.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!