随笔分类 - javascript
js基础
摘要:- <template> <div> <header>正切函数 循环 定义域[-Math.PI/2, Math.PI/2] 值域(-无穷, +无穷)</header> <canvas id="canvas"></canvas> <header>双曲线正弦函数 (-无穷, +无穷) 值域(-无穷, +
阅读全文
摘要:- const templateRe = /\{ *([\w_ -]+) *\}/g; export function template(str, data) { return str.replace(templateRe, (str, key) => { let value = data[key]
阅读全文
摘要:- import dayjs from 'dayjs'; import utc from 'dayjs/plugin/utc'; import timezone from 'dayjs/plugin/timezone'; // dayjs提供两个插件,然后就可以调用tz方法,将本地时间转换成指定时区
阅读全文
摘要:- var a = { name: "a", age: 10, gender: "female" }; var b = { name: "b", age: 15, gender: "male", getGender() { return this.gender; }, }; var c = { na
阅读全文
摘要:- let a = Array.from(new Array(26), (val, index) => String.fromCodePoint(65 + index)); console.log(a) let b = new Array(26).fill(1).map((val,index) =>
阅读全文