Skip to content

Commit 03ac689

Browse files
author
YuChengKai
committed
release v1.0
1 parent 9ecaf96 commit 03ac689

File tree

9 files changed

+18
-89
lines changed

9 files changed

+18
-89
lines changed

Browser/browser-en.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
- [Storage](#storage)
2323
- [cookie,localStorage,sessionStorage,indexDB](#cookielocalstoragesessionstorageindexdb)
2424
- [Service Worker](#service-worker)
25-
- [Rendering machanism](#rendering-machanism)
25+
- [Rendering mechanism](#rendering-mechanism)
2626
- [Difference between Load & DOMContentLoaded](#difference-between-load--domcontentloaded)
2727
- [Layers](#layers)
2828
- [Repaint & Reflow](#repaint--reflow)
@@ -445,7 +445,7 @@ Refreshing the page, we can see that our cached data is read from the Service Wo
445445

446446
![](https://user-gold-cdn.xitu.io/2018/3/28/1626b20e4f8f3257?w=2818&h=298&f=png&s=74833)
447447

448-
# Rendering machanism
448+
# Rendering mechanism
449449

450450
The machanism of the browser engine usually has the following steps:
451451

InterviewMapMind-en.png

752 KB
Loading

InterviewMapMind.png

837 KB
Loading

JS/JS-en.md

+4-78
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
- [`==` operator](#-operator)
1111
- [Comparison Operator](#comparison-operator)
1212
- [Typeof](#typeof)
13-
- [Type Conversion](#type-conversion-1)
14-
- [Converting to Boolean](#converting-to-boolean-1)
15-
- [Objects to Primitive Types](#objects-to-primitive-types-1)
16-
- [Arithmetic Operators](#arithmetic-operators-1)
17-
- [`==` operator](#-operator-1)
18-
- [Comparison Operator](#comparison-operator-1)
1913
- [New](#new)
2014
- [This](#this)
2115
- [Instanceof](#instanceof)
@@ -29,6 +23,7 @@
2923
- [Modularization](#modularization)
3024
- [CommonJS](#commonjs)
3125
- [ADM](#adm)
26+
- [The differences between call, apply, bind](#the-differences-between-call-apply-bind)
3227
- [simulation to implement `call` and `apply`](#simulation-to-implement---call-and--apply)
3328
- [Promise implementation](#promise-implementation)
3429
- [Generator Implementation](#generator-implementation)
@@ -182,76 +177,6 @@ let undefined = 1
182177
a === void 0
183178
```
184179

185-
# Type Conversion
186-
187-
## Converting to Boolean
188-
189-
Except `undefined``null``false``NaN``''``0``-0`, all of the values, including objects, are converted to `true`.
190-
191-
## Objects to Primitive Types
192-
193-
When objects are converted, `valueOf` and `toString` will be called, respectively in order. These two methods can also be overridden.
194-
195-
```js
196-
let a = {
197-
valueOf() {
198-
return 0
199-
}
200-
}
201-
```
202-
203-
## Arithmetic Operators
204-
205-
Only for additions, if one of the parameters is a string, the other will be converted to the string as well. For all other operations, as long as one of the parameters is a number, the other will be converted to a number.
206-
207-
Additions will invoke three types of type conversions: to primitive types, to numbers, and to string.
208-
209-
```js
210-
1 + '1' // '11'
211-
2 * '2' // 4
212-
[1, 2] + [2, 1] // '1,22,1'
213-
// [1, 2].toString() -> '1,2'
214-
// [2, 1].toString() -> '2,1'
215-
// '1,2' + '2,1' = '1,22,1'
216-
```
217-
218-
Note the expression `'a' + + 'b'` for addition.
219-
220-
```js
221-
'a' + + 'b' // -> "aNaN"
222-
// since ++ 'b' -> NaN
223-
// You might have seen + '1' -> 1
224-
```
225-
226-
## `==` operator
227-
228-
![](https://user-gold-cdn.xitu.io/2018/3/30/16275cb21f5b19d7?w=1630&h=1208&f=png&s=496784)
229-
230-
`toPrimitive` in the above figure is converting objects to primitive types.
231-
232-
`===` is usually recommended to compare to values. However, if you would like to know if a value is `null`, you can use `xx == null`.
233-
234-
Let's take a look at an example `[] == ![] // -> true`. The following explains why the expression evaluates to `true`.
235-
236-
```js
237-
// [] converting to true, then take the opposite to false
238-
[] == false
239-
// with #8
240-
[] == ToNumber(false)
241-
[] == 0
242-
// with #10
243-
ToPrimitive([]) == 0
244-
// [].toString() -> ''
245-
'' == 0
246-
// with #6
247-
0 == 0 // -> true
248-
```
249-
250-
## Comparison Operator
251-
252-
1. If it's an object, `toPrimitive` is used.
253-
2. If it's a string, `unicode` character index is used to compare.
254-
255180
# New
256181

257182
1. Create a new object
@@ -787,6 +712,7 @@ define(function(require, exports, module) {
787712
var b = require('./b')
788713
b.doSomething()
789714
})
715+
```
790716
791717
# The differences between call, apply, bind
792718
@@ -816,7 +742,7 @@ We can consider how to implement them from the following points
816742
* If the first parameter isn’t passed, then the first parameter will default to `window`
817743
* Change what `this` refers to, which makes new object capable of executing the function. Then let’s think like this: add a function to a new object and then delete it after the execution.
818744
819-
```js
745+
```js
820746
Function.prototype.myCall = function (context) {
821747
var context = context || window
822748
// Add an property to the `context`
@@ -834,7 +760,7 @@ Function.prototype.myCall = function (context) {
834760
835761
The above is the main idea of simulating `call`, and the implementation of `apply` is similar.
836762
837-
```js
763+
```js
838764
Function.prototype.myApply = function (context) {
839765
var context = context || window
840766
context.fn = this

Network/Network_en.md

+7-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- [Header](#header)
1212
- [State machine](#state-machine)
1313
- [Three-way handshake in opening a connection](#three-way-handshake-in-opening-a-connection)
14-
- [Four-handshake of disconnect.](#four-handshake-of-disconnect)
14+
- [Four-handshake of disconnect](#four-handshake-of-disconnect)
1515
- [ARQ protocol](#arq-protocol)
1616
- [Stop-and-Wait ARQ](#stop-and-wait-arq)
1717
- [Continuous ARQ](#continuous-arq)
@@ -26,13 +26,14 @@
2626
- [HTTP](#http)
2727
- [Difference between POST & GET](#difference-between-post--get)
2828
- [Common Status Code](#common-status-code)
29+
- [Common Fields](#common-fields)
2930
- [HTTPS](#https)
3031
- [TLS](#tls)
3132
- [HTTP/2](#http2)
3233
- [Binary Transport](#binary-transport)
3334
- [MultiPlexing](#multiplexing)
3435
- [Header compression](#header-compression)
35-
- [server push](#server-push)
36+
- [Server push](#server-push)
3637
- [QUIC](#quic)
3738
- [DNS](#dns)
3839
- [What happens when you navigate to an URL](#what-happens-when-you-navigate-to-an-url)
@@ -130,7 +131,7 @@ Imagine that, the client sends a connect request called A, but the network is ba
130131

131132
PS: Through connecting, if any end is offline, it needs to retransmit, generally, five times. You can limit the times of retransmitting or refuse the request if can't handle it.
132133

133-
### Four-handshake of disconnect.
134+
### Four-handshake of disconnect
134135

135136
![](https://user-gold-cdn.xitu.io/2018/5/2/1631fb807f2c6c1b?w=640&h=512&f=png&s=31059)
136137

@@ -318,6 +319,8 @@ Technically:
318319
- 501 Not Implemented: The server cannot fulfil the request.
319320
- 503 Service Unavailable: The server is currently unavailable because it is overloaded or down for maintenance.
320321

322+
## Common Fields
323+
321324
| Common Fields | Description |
322325
| :---------------: | :----------------------------------------------------------: |
323326
| Cache-Control | It tells caching mechanisms |
@@ -445,7 +448,7 @@ In HTTP/1. X, we transfer data of the header by plain text. In the case where th
445448

446449
In HTTP 2.0, the header of the transport was encoded using the HPACK compression format, reducing the size of the header. The index table is maintained at both ends to record the occurrence of the header. The key name of the already recorded header can be transmitted during the transmission. After receives the data, the corresponding value can be found by the key.
447450

448-
## server push
451+
## Server push
449452

450453
In HTTP/2, the server can push resources to the client without the client having to request. Imagine that, something in the server is necessary for the client, so the server can push the associated resources ahead of time to reduce the delay time. By the way, we can also use `pre-fetch` if the client is compatible.
451454

README-ZH.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
# 大纲
4545

46-
![mind](./mind.png)
46+
![mind](./InterviewMapMind.png)
4747

4848
## 贡献
4949

@@ -70,7 +70,7 @@
7070

7171
## 支持我们
7272

73-
如果图谱在面试中或者学习中帮助到你了,你可以请我 [支持我们的工作](https://github.com/KieSun/InterviewMap/issues/20)
73+
如果图谱在面试中或者学习中帮助到你了,你可以 [支持我们的工作](https://github.com/KieSun/InterviewMap/issues/20)
7474

7575
## 协议
7676

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The contents of the repository will update continuously, and more contents will
4747

4848

4949
# Outline
50-
![mind](./mind.png)
50+
![mind](./InterviewMapMind-en.png)
5151

5252

5353
## Contributing

Safety/safety-en.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- [How to attack](#how-to-attack-1)
1111
- [How to defend](#how-to-defend-1)
1212
- [SameSite](#samesite)
13-
- [Verify Referer](#verify--referer)
13+
- [Verify Referer](#verify-referer)
1414
- [Token](#token)
1515
- [Password security](#password-security)
1616
- [Add salt](#add-salt)
@@ -136,7 +136,7 @@ There are several rules for defending against CSRF:
136136

137137
The `SameSite` attribute can be set on cookies. This attribute sets the cookie not to be sent along with cross-domain requests. This attribute can greatly reduce the CSRF attack, but this attribute is currently not compatible with all browsers.
138138

139-
#### Verify Referer
139+
#### Verify Referer
140140

141141
For requests that need protection against CSRF, we can verify the Referer to determine if the request was initiated by a third-party website.
142142

mind.png

-839 KB
Binary file not shown.

0 commit comments

Comments
 (0)