- 博客(4)
- 收藏
- 关注
原创 函数
//1、写一个函数,功能是告知你所选定的小动物的叫声 function sound(animal){ switch(animal){ case ‘dog’: console.log(‘wang!’); return; case ‘cat’: console.log(‘miao~’); return; case ‘fish’: console.log(‘ooo~’) return; } } //2、...
2018-11-17 22:35:13 181
原创 类型转换
1.显示类型转换 number(mix); parseInt(string,radix); parseFloat(string); toString(radix); string(mix); boolean() var num = Number(‘123’); //Number(‘123’)会把字符串123转换为数字123;并且返回值; //null --> 0 undefinde...
2018-11-15 22:40:31 105
原创 JS-01
JS 1.计算2的n次幂,n可输入,n为自然数。 var mul = 1; var n = parseInt(window.prompt(“input”)); for(var i = 0; i <n; i++){ mul *= 2; } document.write(mul); 2.计算n的阶乘,n可输入。 阶乘:5!5 * 4 * 3 * 2 * 1 var ne = 1; var n =...
2018-11-13 22:49:34 121
原创 css+html
/margin塌陷-父子嵌套、垂直方向的margin取最大值/ .wrapper{ width: 100px; height: 100px; margin-left:100px; margin-top: 100px; /border: 1px solid black;/ background-color: green; } .content{ width: 50px; height: 50px; ...
2018-10-23 19:27:15 226
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人