当前位置:网站首页>JS topic - console log()
JS topic - console log()
2022-07-05 15:20:00 【Shepherd Wolf】
1. function 、 Variable Scope
(1)
Foo()
function Foo () {
console.log(this.getName())
}
var getName = function () {
console.log(4)
}
Foo()
function getName () {
console.log(5)
}
Foo()
(2)
Foo()
function Foo () {
getName = function () {
console.log(1)
}
console.log(this.getName())
}
var getName = function () {
console.log(4)
}
Foo()
function getName () {
console.log(5)
}
Foo()(3)
function Foo () {
getName = function () {
console.log(1)
}
return this
}
Foo.getName = function () {
console.log(2)
}
new Foo.getName()(4)
function Foo () {
getName = function () {
console.log(1)
}
return this
}
Foo.getName = function () {
console.log(2)
}
Foo.prototype.getName = function () {
console.log(3)
}
var getName = function () {
console.log(4)
}
function getName () {
console.log(5)
}
Foo.getName()
getName()
Foo().getName()
getName()
new Foo.getName()
new Foo().getName()
new new Foo().getName()(5)
function test() {
console.log(1, this)
return function() {
console.log(2, this)
return function () {
console.log(3, this)
}
};
};
document.querySelector("input").addEventListener('input', test()());(6)
for (var i = 0; i <10; i++) {
setTimeout(function() {
console.log(i);
}, 0);
}
for (let i = 0; i <10; i++) {
setTimeout(function() {
console.log(i);
}, 0);
}【 answer 】:
1.
(1) 5 4 4
(2) 1 1 1
(3) 2
(4) 2 4 1 1 2 3 3
(5) Page initialization this-> window window. (input After entering the value this-> input)
(6) 10 individual 10; 0 1 2 3 4 5 6 7 8 9
边栏推荐
- Database learning - Database Security
- Severlet learning foundation
- Bugku's Ah Da
- Bugku cyberpunk
- Coding devsecops helps financial enterprises run out of digital acceleration
- Fr exercise topic - simple question
- go学习 ------jwt的相关知识
- 【jvm】运算指令
- Easyocr character recognition
- 729. My schedule I: "simulation" & "line segment tree (dynamic open point) &" block + bit operation (bucket Division) "
猜你喜欢

Number protection AXB function! (essence)

Common MySQL interview questions

Common redis data types and application scenarios

Under the crisis of enterprise development, is digital transformation the future savior of enterprises
![P6183 [USACO10MAR] The Rock Game S](/img/f4/d8c8763c27385d759d117b515fbf0f.png)
P6183 [USACO10MAR] The Rock Game S

Bugku's steganography

MongDB学习笔记

I spring and autumn blasting-1

No one consults when doing research and does not communicate with students. UNC assistant professor has a two-year history of teaching struggle

Interpretation of Apache linkage parameters in computing middleware
随机推荐
Aike AI frontier promotion (7.5)
GPS original coordinates to Baidu map coordinates (pure C code)
I include of spring and Autumn
Install PHP extension spoole
Ctfshow web entry information collection
可视化任务编排&拖拉拽 | Scaleph 基于 Apache SeaTunnel的数据集成
Go learning ----- relevant knowledge of JWT
Using tensorboard to visualize the training process in pytoch
[detailed explanation of Huawei machine test] happy weekend
maxcompute有没有能查询 表当前存储容量的大小(kb) 的sql?
Stop B makes short videos, learns Tiktok to die, learns YouTube to live?
Bugku's Eval
How can the boss choose programmers to help me with development?
Bugku cyberpunk
NBA赛事直播超清画质背后:阿里云视频云「窄带高清2.0」技术深度解读
Handwriting promise and async await
Photoshop插件-动作相关概念-非加载执行动作文件中动作-PS插件开发
Stm32+bh1750 photosensitive sensor obtains light intensity
P1451 calculate the number of cells / 1329: [example 8.2] cells
CPU design related notes