-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjsClass.html
80 lines (71 loc) · 1.64 KB
/
jsClass.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
<meta name="renderer" content="webkit">
<title>jsClass练习</title>
<meta name="description" content="首页描述"/>
<meta name="keywords" content="首页关键词"/>
<meta name="author" content="Web Layout:amu"/>
<meta name="format-detection" content="telephone=no,date=no,address=no,email=no,url=no"/>
<link rel="stylesheet" href="./src/style/case.css?v=2">
</head>
<body>
</body>
<script src="https://cdn.bootcss.com/vConsole/3.3.0/vconsole.min.js"></script>
<script>
//var vConsole = new VConsole();
let arr = [1,2,3];
// let item = arr[0];
// item*=2;
//console.log(arr);
let newArr=[];
arr.map(item=>{
//console.log(item,item *= 2);
newArr.push(item *= 2)
//return item *= 2;
});
//console.log(arr,arr[0],arr[1],arr[2]);
//console.log(newArr);
let arrObj = [{a:1},{a:2},{a:3}]
//console.log(arrObj);
arrObj.map(item=>{
return item.a *= 2;
})
//console.log(arrObj);
class User{
constructor(name,id){
this.name = name;
this.id = id
}
say(){
//console.log(this.name)
}
}
//console.log(typeof User) //function
//console.log(User === User.prototype.constructor) //true
let admin = new User();
//console.log(admin)
function test(pp){
console.log(pp)
//debugger
pp.age =26
pp = {
name:'aa',
age:10
}
return pp
}
const p1 = {
name:'vv',
age:12
}
console.log(p1)
const p2 = test(p1)
console.log(p1)
// debugger
// console.log(p2)
</script>
</html>