js 字符串“123”,变成整数123,不用parseInt 函数

 1 var s = "123";

2 console.log(s.charAt(0)*100+s.charAt(1)*10+s.charAt(2)*1); 

posted @ 2016-10-02 00:34  游离的心  阅读(741)  评论(0编辑  收藏  举报