javascript using the unary-plus and unary-minus operator 一元操作符
摘要:
新手入门啊,看看就明白了!<script src='jquery.js'></script>......<script>var a=1;var b='2';//output numberconsole.log(typeof(-b));console.log(typeof(+b));//output stringconsole.log(typeof(b));//output 12console.log(a + b);//output 3console.log(a + Number(b));console.log(a + +b); 阅读全文
posted @ 2011-03-05 18:05 blackcore 阅读(408) 评论(0) 推荐(0) 编辑