2018-03-13 23:12:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## JavaScript
|
|
|
|
|
|
|
|
|
|
### 存储相关:请描述以下cookie、localStorage、sessionStorage的区别。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
在H5之前,cookie一直都是本地存储的一个重要的方法。直到后面的两个出现了, 就开始用后面的两个做本地存储。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
**1、cookie**:
|
|
|
|
|
|
|
|
|
|
- 本身用于客户端和服务器端的通信。
|
|
|
|
|
|
|
|
|
|
- 但是它有本地存储的功能,于是就被“借用”。
|
|
|
|
|
|
|
|
|
|
我们可以通过`document.cookie`获取和修改cookie,获取到的其实就是一个字符串。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cookie用于存储时的缺点:
|
|
|
|
|
|
|
|
|
|
- 存储量太小,只有4kb
|
|
|
|
|
|
|
|
|
|
- 所有http请求都带着,会影响获取资源的效率
|
|
|
|
|
|
|
|
|
|
- api简单,需要封装才能用。`document.cookie = ...`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## ES6
|
|
|
|
|
|
|
|
|
|
### for each、for in、for of的区别
|
|
|
|
|
|
|
|
|
|
- `foreach`用于遍历数组,是数组的一个方法。不支持 return。
|
|
|
|
|
|
2018-03-14 22:49:34 +08:00
|
|
|
|
- `for ... in`获取的对象是index索引值。
|
2018-03-13 23:12:27 +08:00
|
|
|
|
|
2018-03-14 22:49:34 +08:00
|
|
|
|
- `for ... of`获取的是对象里的值。
|
2018-03-13 23:12:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## GitHub
|
|
|
|
|
|
|
|
|
|
- [荐]面试题和答案:<https://github.com/markyun/My-blog/tree/master/Front-end-Developer-Questions/Questions-and-Answers>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- 面试题和答案:<https://github.com/qiu-deqing/FE-interview>
|
|
|
|
|
|
|
|
|
|
有个题是,浏览器输入url,有哪些过程
|
|
|
|
|
|
|
|
|
|
- [讲到了Cookie和session](https://github.com/WarpPrism/Blog/issues/5)
|
|
|
|
|
|
|
|
|
|
- 这个也很全:<https://github.com/gnipbao/Front-end-Interview-questions>
|
|
|
|
|
|
|
|
|
|
- <https://github.com/giscafer/front-end-manual/issues/3>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 浏览器输入hrl,有哪些过程
|
|
|
|
|
|
|
|
|
|
- [码农翻身 | 小白科普:从输入网址到最后浏览器呈现页面内容,中间发生了什么?](https://mp.weixin.qq.com/s/3_DZKSP492uq9RfQ3eW4_A)
|
|
|
|
|
|
|
|
|
|
- 从输入URL到页面加载发生了什么:<https://segmentfault.com/a/1190000006879700>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 按时间排列
|
|
|
|
|
|
|
|
|
|
### 2018-03-11
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- web前端面试题汇总:<https://www.jianshu.com/p/2f7eb1ad7174>
|
|
|
|
|
|
|
|
|
|
- 2017前端面试题及答案总结:<https://yeaseonzhang.github.io/2017/09/17/2017%E5%89%8D%E7%AB%AF%E9%9D%A2%E8%AF%95%E9%A2%98%E5%8F%8A%E7%AD%94%E6%A1%88%E6%80%BB%E7%BB%93/>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### 2018-03-12-今日头条面试题
|
|
|
|
|
|
|
|
|
|
- [ 今日头条一面笔试面试题!!!!!完整](http://blog.csdn.net/github_35924246/article/details/75675901)
|
|
|
|
|
|