Skip to content

Commit 4edf0fb

Browse files
committed
javascript
1 parent 90be3a7 commit 4edf0fb

File tree

3 files changed

+155
-3
lines changed

3 files changed

+155
-3
lines changed

docs/javascript/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,39 @@ Math.abs(-1) // 1
996996

997997
---
998998

999+
#### js 模块化规范?
1000+
1001+
<details><summary><b>答案</b></summary>
1002+
<p>
1003+
1004+
| 模块化 | 元素能否点击 | 元素是否消失 | 性能 | 继承 |
1005+
| -------- | ------------ | ------------ | ---- | ---------- |
1006+
| CommonJS | | | | 非继承属性 |
1007+
| AMD | | | | |
1008+
| CMD | | | | |
1009+
1010+
```javascript
1011+
```
1012+
1013+
</p>
1014+
</details>
1015+
1016+
---
1017+
1018+
#### new 操作符具体干了什么呢??
1019+
1020+
<details><summary><b>答案</b></summary>
1021+
<p>
1022+
1023+
- 1、创建一个空对象,并且 this 变量引用该对象,同时还继承了该函数的原型。
1024+
- 2、属性和方法被加入到 this 引用的对象中。
1025+
- 3、新创建的对象由 this 所引用,并且最后隐式的返回 this 。
1026+
1027+
</p>
1028+
</details>
1029+
1030+
---
1031+
9991032
#### 如何找到失散已久的组织?
10001033

10011034
<details><summary><b>答案</b></summary>

docs/webpack/README.md

Lines changed: 73 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,43 @@
1919
<details><summary><b>答案</b></summary>
2020
<p>
2121
code splitting
22+
23+
- entry 项目入口
24+
- output 出口文件
25+
- module 模块的处理
26+
- loader
27+
- plugin
28+
29+
</p>
30+
</details>
31+
32+
---
33+
34+
#### webpack Tree-shaking?
35+
36+
<details><summary><b>答案</b></summary>
37+
<p>
38+
39+
记住需要使用 ES6 模块和 UglifyJsPlugin 插件,以及配置 optimization 选项,设置 usedExports 和 sideEffects 为 true。
40+
41+
```javascript
42+
// webpack.config.js
43+
44+
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
45+
const HtmlWebpackPlugin = require('html-webpack-plugin')
46+
47+
module.exports = {
48+
mode: 'none',
49+
optimization: {
50+
minimize: true,
51+
minimizer: [new UglifyJsPlugin()],
52+
usedExports: true,
53+
sideEffects: true,
54+
},
55+
plugins: [new HtmlWebpackPlugin()],
56+
}
57+
```
58+
2259
</p>
2360
</details>
2461

@@ -52,6 +89,27 @@ code splitting
5289

5390
提取公共代码
5491

92+
splitChunks
93+
94+
</p>
95+
</details>
96+
97+
---
98+
99+
#### 小程序提升性能?
100+
101+
<details><summary><b>答案</b></summary>
102+
<p>
103+
104+
- 使用防抖节流,onPageScroll,按钮
105+
- 骨架屏
106+
- SetData 不渲染的数据不使用,合并 setData
107+
- 分包,分包预下载,独立分包
108+
- 使用 CDN 图片
109+
110+
精简首屏数据
111+
我们推荐开发者延迟请求非关键渲染数据,与视图层渲染无关的数据尽量不要放在 data 中,加快页面渲染完成时间
112+
55113
</p>
56114
</details>
57115

@@ -61,13 +119,25 @@ code splitting
61119

62120
<details><summary><b>答案</b></summary>
63121
<p>
64-
65-
&nbsp;&nbsp;&nbsp;&nbsp;扫描下方二维码:point_down::point_down:关注“前端女塾”
66122

67-
![logo](https://imgs.solui.cn/wx/640.gif ':size=262x224')
123+
&nbsp;&nbsp;&nbsp;&nbsp;扫描下方二维码:point_down::point_down:关注“前端女塾”
124+
125+
![logo](https://imgs.solui.cn/wx/640.gif ':size=262x224')
68126
关注公众号:回复“加群”即可加 前端仙女群
69127

70128
</p>
71129
</details>
72130

73131
---
132+
133+
```
134+
135+
```
136+
137+
```
138+
139+
```
140+
141+
```
142+
143+
```

docs/work/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# 软技能
2+
3+
题目和答案通过网络整理,如有错误欢迎 pr 修正。
4+
5+
题目可能不会按顺序添加,不要直接拉到最后哦,多看几遍吧,温故而知新。
6+
7+
答案被折叠,点击即可查看答案。:heart:
8+
9+
查看其他分类题目
10+
11+
:purple_heart: [JAVASCRIPT](/)
12+
:heart: [HTTP](/http/README.md)
13+
14+
---
15+
16+
#### 你在的公司有没有做代码审查(CodeReview)?
17+
18+
<details><summary><b>答案</b></summary>
19+
<p>
20+
21+
</p>
22+
</details>
23+
24+
---
25+
26+
#### 你们团建一般都怎么实施?
27+
28+
<details><summary><b>答案</b></summary>
29+
<p>
30+
31+
</p>
32+
</details>
33+
34+
---
35+
36+
#### 如何找到失散已久的组织?
37+
38+
<details><summary><b>答案</b></summary>
39+
<p>
40+
41+
&nbsp;&nbsp;&nbsp;&nbsp;扫描下方二维码:point_down::point_down:关注“前端女塾”
42+
43+
![logo](https://imgs.solui.cn/wx/640.gif ':size=262x224')
44+
关注公众号:回复“加群”即可加 前端仙女群
45+
46+
</p>
47+
</details>
48+
49+
---

0 commit comments

Comments
 (0)