Correction status:qualified
Teacher's comments:加油!
这周开始,我们对JavaScript进行了学习,今天是对JavaScript的基础学习,有变量的声明、数据类型及条件语句等,在有对它有一定了解的基础上,并能记住。下面是我练习的结果:
<!DOCTYPE html> <html> <head> <title>JavaScript第一章(基础)</title> <link rel="icon" type="image/x-icon" href="static/images/favicon.ico"> <script> document.write('你好') </script> <script type="text/javascript" src="static/all.js"></script> </head> <body> <script type="text/javascript"> var x=6; console.log(x); var y=6,z=11; console.log(z+y); var a; document.write(a); var b=1; var c="我是无忌哥哥!"; var d=3; var name=['aaa','bbb','ccc','ddd']; var e={ name:'张无忌', age:24, weight:'60kg', height:'175cm' } document.write('<hr>') // 给学生的成绩划分等级 var grade=95; if(grade>=90){ document.write('优秀!'); }else if(grade>=80 && grade<90){ document.write('良好!'); }else if(grade>=70 && grade<80){ document.write('良!'); }else if(grade>=60 && grade<70){ document.write('及格!'); }else{ document.write('不及格!'); } // 判断是否为闰年 var years=2000; if(years%4==0 && years%4!==0){ alert('是闰年!'); }else if(years%4==0 && years%100==0){ alert('是世纪闰年!'); }else{ alert('不是闰年!'); } </script> </body> </html>
点击 "运行实例" 按钮查看在线实例
总结:JavaScript对于我们初学者来说,不知是能够记住它,还要对它有深入的理解,并能够运用到实际的案列中,这需要我们多加练习!