跳到内容

使用情况

您如何使用 JavaScript?

JavaScript/TypeScript 平衡

We're now firmly in the TypeScript era. 67% of respondents stated they write more TypeScript than JavaScript code – while the single largest group consisted of people who only write TypeScript.

0%
7%
14%
21%
28%
34%
1

100% JS

915
2

|

559
3

|

446
4

|

185
5

50/50

625
6

|

352
7

|

1,245
8

|

3,172
9

100% TS

3,936
0%
7%
14%
21%
28%
34%
受访者百分比
您如何分配编写 JavaScript 和 TypeScript 代码的时间?

Compiled Code Balance

It should come as no surprise that in 2024, almost all of our JavaScript code goes through a build step. While bundlers and build tools certainly add complexity to our development process, they are most likely here to stay.

0%
11%
22%
32%
43%
54%
1

0% Compiled

262
2

|

185
3

|

192
4

|

118
5

50%

629
6

|

233
7

|

1,020
8

|

2,449
9

100% Compiled

5,927
0%
11%
22%
32%
43%
54%
受访者百分比
What proportion of the JavaScript code you write for the browser goes through a build step?

AI Code Generation

For all the talk of AI-assisted coding, most of us still only use AI tools sparingly. And in fact, a whole 20% do not use them whatsoever to produce code.

0%
8%
15%
23%
30%
38%
1

0% AI

2,263
2

|

4,319
3

|

2,573
4

|

837
5

50%

751
6

|

285
7

|

270
8

|

55
9

100% AI

18
0%
8%
15%
23%
30%
38%
受访者百分比
What proportion of the code you produce is AI-generated?

JavaScript 使用情况

It's always good to know in what context respondents are writing JavaScript code, and the vast majority are using it as part of their day job.

0%
19%
38%
57%
76%
95%
1

专业

10,842
2

作为爱好

4,593
3

作为学生

1,143
0%
19%
38%
57%
76%
95%
受访者百分比
您主要在什么情况下使用 JavaScript?

JavaScript 使用情况

Virtually every respondent stated that they use JavaScript for frontend development, which makes sense given the language's origins.

0%
20%
39%
59%
79%
98%
1

前端开发

11,268
2

后端开发

7,345
3

移动应用

2,994
4

桌面应用

2,072
5

数据可视化

1,653
6

图形和动画

1,302
7

数据分析

854
8

游戏开发

651
9

机器学习

263
10

嵌入式应用

258
0%
20%
39%
59%
79%
98%
受访者百分比
您使用 JavaScript 来做什么?

While the largest industry sector consisted of developers building tools for other developers, the highest-paying one turned out to be Advertising.

0%
8%
17%
25%
34%
42%
1

编程和技术工具

4,299
2

咨询服务

3,555
3

电子商务与零售

2,668
4

金融

1,796
5

营销/销售/分析工具

1,558
6

教育

1,494
7

娱乐

1,256
8

卫生保健

1,035
9

新闻、媒体和博客

939
10

政府

836
0%
8%
17%
25%
34%
42%
受访者百分比
你在哪个行业工作?

Despite modern JavaScript meta-frameworks now supporting intricate rendering strategies, the most common application patterns remained the most traditional ones: single-page apps and server-side rendering.

0%
18%
36%
54%
72%
90%
1

单页面应用 (SPA)

10,027
2

服务端渲染 (SSR)

6,559
3

静态站点生成 (SSG)

5,072
4

多页面应用 (MPA)

4,399
5

局部注水

2,320
6

岛屿架构

1,573
7

渐进增强

1,480
8

增量静态生成

1,053
9

流式服务端渲染

956
10

局部预渲染

906
0%
18%
36%
54%
72%
90%
受访者百分比
您在去年使用过以下哪些架构和渲染模式?

JavaScript 痛点

Code architecture is always a concern once a codebase gets past a certain size, so it makes sense that it topped the rankings of overall JavaScript pain points, followed by state and dependency management.

0%
7%
14%
21%
28%
35%
1

代码架构

3,719
2

全局数据管理

3,290
3

依赖管理

3,053
4

构建工具

2,925
5

性能

2,538
6

调试

2,355
7

日期管理

2,338
8

类型

2,338
9

异步代码

1,151
10

查找包

1,102
0%
7%
14%
21%
28%
35%
受访者百分比
您最头疼 JavaScript 的哪些方面?

There are currently quite a few TC39 proposals that are on the verge of becoming a reality. Temporal and Decorators stood out this year as the ones respondents were most excited about.

0%
15%
30%
45%
59%
74%
1

6,637
2

3,392
3

1,312
4

1,259
5

978
6

888
7

750
8

695
9

669
10

462
0%
15%
30%
45%
59%
74%
受访者百分比
Which of these active JavaScript proposals are you most excited about?

缺失的功能

While the lack of native static typing has long been felt by the community, it's interesting to see Signals making an entrance at number 3 on this list, despite not being part of the most popular front end framework.

0%
11%
21%
32%
43%
53%
1

静态类型

5,403
2

标准库

4,378
3

3,985
4

2,362
5

1,919
6

1,905
7

1,889
8

1,366
9

928
10

701
11

356
12

307
13

其他答案

169
0%
11%
21%
32%
43%
53%
受访者百分比
你觉得 JavaScript 目前缺少什么?

It's clear that survey respondents want native types, and that they hope to seem them implemented with a TypeScript-like syntax.

This year's question phrasing sadly did not make a clear distinction between runtime types and TypeScript-like type-as-annotations, so it remains to be seen which of these two paths will gain the community's favor.

0%
16%
32%
48%
64%
80%
1

As similar to TypeScript as possible

8,362
2

Using comments, similar to JSDoc

1,037
3

I would not like to see them implemented

1,000
4

Type Annotations

5

Similar to TypeScript

6

Similar to Java

7

Similar to Rust

8

Similar to Python

9

其他答案

225
0%
16%
32%
48%
64%
80%
受访者百分比
How would you like to see native types implemented in JavaScript?

Web 技术满意度

0
1
2
3
4
2020
2021
2022
2023
2024
0
1
2
3
4
平均 {axis}
你对 Web 技术的总体状况感到满意吗?

JavaScript 满意度

0
1
2
3
4
2020
2021
2022
2023
2024
0
1
2
3
4
平均 {axis}
你对 JavaScript 的总体状况感到满意吗?
Your Path to Becoming a Senior Web Developer!
Will Sentance
Codesmith

Your Path to Becoming a Senior Web Developer!

Deep dive into JavaScript, the most popular framework React, Web performance, CSS, deploying websites, TypeScript, and functional JavaScript to become a professional web developer today.
Expand Your Abilities to the Server and Master the Fullstack
Jem Young
Netflix

Expand Your Abilities to the Server and Master the Fullstack

Set up servers, create APIs, and deploy your code to the world by learning the full stack.
感谢合作伙伴对我们的支持! 了解更多。