js 原生开发:实现页面带参跳转:从传参到接参 目前我知道有两种方法: 1.通过地址栏的跳转链接带参==index.html== 1234567891011121314151617181920212223242526272829<!DOCTYPE html><html lang="zh"><head> <meta charset="U javascript #js #javascript
js 原生最简单简洁的打印 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677<!DOCTYPE html><html lang="en"> javascript #js #javascript
js 原生请求fetch和ajax 第一种:XMLHttpRequest实例 123456789101112131415161718192021222324252627282930313233343536373839404142<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> javascript #js #javascript
js 去掉字符串首尾空白字符 trim() 123456789101112131415<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> <s javascript #js #javascript
js 只保留数字为几位数 toPrecision() 1234567891011121314<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> javascript #js #javascript
js 合并两个数组【两数组间对应的下标,对应合并】 如下图两块,对应合并:将这两个数组合并成: 日期在前,星期在后,中间用空格隔开代码如下: 123for(let l in dateData){ mergeWeekDate.push(dateData[l].substring(5, dateData[l].length) +' '+ weekData[l]); // 意思就是mergeWeekDate装入 javascript #js #javascript
js 对比两个数组是否相同 12345678910111213141516171819202122232425262728293031323334<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="wi javascript #js #javascript
js 复制 12345678910111213141516171819202122<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>Document</title></head><body> javascript #js #javascript
js 对比数组中最大值或最小值 使用Math.max()、Math.min() 1234var arr = [1,2,3,4,5,6,7,8,9];console.log(Math.max(...arr));console.log(Math.min(...arr)); 输出结果: javascript #js #javascript
js 对象动态增加属性key 语法: 对象[属性] = "值"; // 在属性的地方可以放变量 示例: 1234567891011121314151617181920<!DOCTYPE html><html> <head> <meta charset="utf-8" /> <meta name=&q javascript #js #javascript