摘要: var a =2; for(var i=1;i"); a++; } else{ document.write(j+"*"+i+"="+i*j... 阅读全文
posted @ 2016-01-14 13:20 Barbie7 阅读(421) 评论(0) 推荐(0) 编辑
摘要: total>=100?total*0.8:total;//true执行冒号前面的;false执行冒号后面的等价于if(total>=100){ total=total*0.8;}else{ total=total;} 阅读全文
posted @ 2016-01-14 11:13 Barbie7 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 六种数据类型:object、string、null、undefined、boolean、number;任何数据类型+“”都会转化成字符串;null与undefined虽然都是空,null的typeof是object,undefined的typeof是undefined;number的转换有pares... 阅读全文
posted @ 2016-01-14 11:13 Barbie7 阅读(145) 评论(0) 推荐(0) 编辑
摘要: var year = parseInt(prompt("请输入年份"));if((year%4==0 && year%100!=0) || year%400==0){ console.log("闰年");}else{ console.log("非闰年");} 阅读全文
posted @ 2016-01-14 10:33 Barbie7 阅读(149) 评论(0) 推荐(0) 编辑