-
Notifications
You must be signed in to change notification settings - Fork 0
/
jsss.html
56 lines (49 loc) · 1.59 KB
/
jsss.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
async function fetchOptions() {
return ['aaa', 'bbb', 'ccc'];
}
<select value={} >
<option value="aaa"></option>
</select>
<button>
<div>
</div>
<script>
// const strs = ["eat", "tea", "tan", "ate", "nat", "bat"];
// const result = []
// var groupAnagrams = function(strs) {
// const map = new Map();
// for(str of strs){
// // 1.转化为数组后进行排序
// arr = Array.from(str);
// // console.log(arr);
// arr.sort();
// // console.log(arr);
// // 2.将排序后的数组转化成字符串当做key
// let key = arr.toString();
// // console.log(key);
// // 3.创建list数组,若map中能找到检测的key,则等于key.value的数组
// let list = map.get(key)?map.get(key):new Array();
// // 4.将新的元素放入数组
// list.push(str);
// // 5.更新哈希表
// map.set(key,list)
// }
// for (re of map.values()){
// result.push(re)
// }
// return result
// }
// console.log(groupAnagrams(strs))
const pc = ['1','2','3','4'];
const [hr,lx,li,fz] = pc;
</script>
</body>
</html>