摘要: 1.getFullYear():返回4位数的年份 2.getMonth():返回日期中的月份,返回值为0-11 3.getDate():返回月份中的天数 4.getDay():返回星期,返回值为0-6 5.getHours():返回小时 6.getMinutes():返回分 7.getSeconds 阅读全文
posted @ 2019-08-14 16:49 嘻嘻哈喽 阅读(346) 评论(0) 推荐(0) 编辑
摘要: 1.条件语句 if(条件){ 语句 }else{ 语句} } 2.循环语句 例: var a=“hello”; a[0]->h a[1]->e a[2]->l 我们把用数字去代替字节的方法,将数字叫做这个字节的下标(索引) 循环语句的格式 以 for 开头 for(){ } 例: for(var i 阅读全文
posted @ 2019-08-14 11:16 嘻嘻哈喽 阅读(333) 评论(0) 推荐(0) 编辑
摘要: JavaScript基本数据类型: 数值类型(number):分为整型和浮点型 整型:123 浮点型:1.2 2.2 字符串类型(String) 用双引号 或单引号引起来的值 布尔类型(boolean):真(true) 假(false) 未定义类型:Undefined专门用来确定一个已经创建但是没有 阅读全文
posted @ 2019-08-14 10:51 嘻嘻哈喽 阅读(345) 评论(0) 推荐(0) 编辑