jiaqistart
This commit is contained in:
50
js/demo/day4-1.html
Normal file
50
js/demo/day4-1.html
Normal file
@@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<script>
|
||||
var cat = {
|
||||
name: "大喵",
|
||||
run: function () {
|
||||
console.log("我会跑")
|
||||
},
|
||||
eat() {
|
||||
console.log("我在吃东西")
|
||||
}
|
||||
};
|
||||
|
||||
var dog = {
|
||||
name: "大汪",
|
||||
bark() {
|
||||
console.log("汪汪汪")
|
||||
},
|
||||
paqiang(m, n) {
|
||||
console.log(this)
|
||||
console.log(m, n, "我能爬墙")
|
||||
}
|
||||
}
|
||||
|
||||
// 大喵需要借用大汪的paqiang的技能
|
||||
// dog.paqiang.call(cat,1,2)
|
||||
dog.paqiang.apply(cat, [1, 2])
|
||||
dog.paqiang()
|
||||
|
||||
function a(val) {
|
||||
var name = val
|
||||
c = 0
|
||||
function b() { }
|
||||
}
|
||||
var str = 'Hello World'
|
||||
a(1)
|
||||
console.log(window.c)
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
0
js/demo/day4.html
Normal file
0
js/demo/day4.html
Normal file
Reference in New Issue
Block a user