摘要: 普通加载,这个加载因为script放的位置不同,也会有不同的性能。 <head> <script type="text/javascript" src="script.js"></script> </head> 放在head,将script放在head会发生什么? 浏览器的解析顺序是从上到下的,再解 阅读全文
posted @ 2023-03-08 17:38 kihyun 阅读(93) 评论(0) 推荐(0) 编辑
摘要: for...of & for...in 两者都可以用于遍历,不过for in遍历的是数组的索引(index),而for of遍历的是数组元素值(value),对此做了几组实验 关于数组 测试数据: const menu = ['tomato', 'egg', 'rice'] 直接遍历数组:for.. 阅读全文
posted @ 2023-02-15 15:50 kihyun 阅读(256) 评论(0) 推荐(0) 编辑
摘要: This what it 'this' special variable that is created for every execution context. this是在每一个执行上下文中产生的变量的,每一个执行上下文都有自己的this值。this不是静态的,它取决于函数如何被调用,它的值会在 阅读全文
posted @ 2023-02-15 14:37 kihyun 阅读(14) 评论(0) 推荐(0) 编辑
摘要: JavaScript works behind the scenes —— hoisting and TDZ(变量提升和暂时性死区) concept Makes some types of variables accessible/usable in the code before they are 阅读全文
posted @ 2022-10-27 00:53 kihyun 阅读(18) 评论(0) 推荐(0) 编辑
摘要: JavaScript works behind the scenes —— scope and scope chain(作用域和作用域链) what is scope? (作用域的概念) Scope: Space and environment in which a certain variable 阅读全文
posted @ 2022-10-27 00:18 kihyun 阅读(21) 评论(0) 推荐(0) 编辑
摘要: JavaScript works behind the scenes —— execution context(执行上下文) What is execution context? 什么是执行上下文 Environment in which a piece of JavaScript is execu 阅读全文
posted @ 2022-10-26 22:03 kihyun 阅读(16) 评论(0) 推荐(0) 编辑
摘要: what is a JavaScript engine? program that executes JavaScript code. JavaScript引擎是运行JavaScript代码的程序。 how engine works? JavaScript contains a call stack 阅读全文
posted @ 2022-10-12 00:20 kihyun 阅读(21) 评论(0) 推荐(0) 编辑
摘要: API Application Programming Interface: a piece of software that can be used by another piece of software, in order to allow application to talk to eac 阅读全文
posted @ 2022-06-22 01:16 kihyun 阅读(26) 评论(0) 推荐(0) 编辑
摘要: 设置ESLint 安装组件 npm i eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-config-airbnb eslint-plugin-node eslint-plugin-import eslint- 阅读全文
posted @ 2022-06-22 01:12 kihyun 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 中间件 在node执行的过程中,在请求和应答的中间会有很多中间处理不同东西的组件,这样的组件叫做中间件。中间件的执行过程是:请求发送-第一个中间件接收-第一个中间件应答-第一个中间件请求-第二个中间件接收-第二个中间件应答-第二个中间件请求-最终应答。 具体使用: app.use((req, res 阅读全文
posted @ 2022-06-22 01:10 kihyun 阅读(47) 评论(0) 推荐(0) 编辑