摘要:
// 格式化日期 年月日 var date = new Date(); console.log(date.getFullYear()); // 返回当前日期的年 2019 console.log(date.getMonth() + 1); // 月份 返回的月份小1个月 记得月份+1 呦 conso 阅读全文
posted @ 2022-02-09 15:15
Harry宗
阅读(36)
评论(0)
推荐(0)
摘要:
数字对象Math 里面求 最大值方法 -- Math.max(1,12,....) 例: console.log(Math.max(1, 99, 3)); // 99 如果一组数字,里面出现非数字的-- 返回NaN 例: console.log(Math.max(1, 99, 'pink老师')); 阅读全文
posted @ 2022-02-09 14:59
Harry宗
阅读(49)
评论(0)
推荐(0)
摘要:
对象里面的属性调用 : 对象.属性名 ,这个小点 . 就理解为“ 的 ” 对象里面属性的另一种调用方式 : 对象[‘属性名’],注意方括号里面的属性必须加引号 var star = { name : 'pink', age : 18, sex : '男', sayHi : function(){ a 阅读全文
posted @ 2022-02-09 14:51
Harry宗
阅读(45)
评论(0)
推荐(0)