1 Star 0 Fork 0

癫疯丶歌谣/前端牛客网面试题刷题

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
面试题例题220407.html 978 Bytes
一键复制 编辑 原始数据 按行查看 历史
癫疯丶歌谣 提交于 2022-04-07 17:57 . 修改
<!--
* @Author: your name
* @Date: 2022-04-07 17:46:41
* @LastEditTime: 2022-04-07 17:54:58
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \geyao\geyao\面试题例题220407.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>面试题</title>
</head>
<body>
<script>
//谁调用就指向谁
var name = 'window'
const obj = {
name: 'obj',
sayName: function () {
console.log(this.name)
},
}
obj.sayMyName = () => {
console.log(this.name)
}
const fn1 = obj.sayName()
const fn2 = obj.sayMyName()
fn1 // obj
obj.sayName() // window
fn2 // obj
obj.sayMyName() // window
</script>
</body>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/geyaoisgeyao/geyao.git
git@gitee.com:geyaoisgeyao/geyao.git
geyaoisgeyao
geyao
前端牛客网面试题刷题
master

搜索帮助