Skip to content
📜

JavaScript 基础

15 个项目

15 个 JavaScript 实战项目覆盖 DOM 操作、事件处理、异步请求与本地存储,练完即可写进作品集。

  1. 1

    计数器

    构建 button-driven 计数器那个 increments, decrements, and resets. 练习 DOM selection, 事件监听器, and 更新文本内容.

    入门 约 10 分钟
  2. 2

    Random Quote Generator

    构建 button 那个 shows random quote 从数组. 练习数组, random indexing, and 更新 DOM on demand.

    简单 约 15 分钟
  3. 3

    颜色 Changer

    构建 button 那个更改 background 颜色的 box 到 random 颜色. 练习 inline 样式更新 and hex 颜色 generation.

    入门 约 10 分钟
  4. 4

    提示 Calculator

    构建提示 calculator 那个 takes bill 数量 and 提示百分比, 然后 shows 提示 and 总计. 练习数字 parsing, 函数, and DOM 更新.

    简单 约 20 分钟
  5. 5

    简单 Todo 列表

    构建工作 todo 列表 — 添加任务, mark 它们做, and 删除它们. 练习数组, 渲染从 状态, and 事件 delegation.

    中等 约 30 分钟
  6. 6

    简单 Calculator

    构建 calculator 那个能 添加, subtract, multiply, and 划分. 练习函数, 事件 handling, and 更新 DOM 使用 results.

    简单 约 25 分钟
  7. 7

    Enhanced Todo 列表

    构建 todo 列表使用筛选 (所有, active, 已完成) and localStorage persistence. 练习数组方法, 筛选, and 浏览器 storage.

    中等 约 30 分钟
  8. 8

    Weather Lookup

    构建 weather lookup tool 那个获取数据从 free weather API using 异步/等待. 练习获取, JSON parsing, and 错误 handling.

    中等 约 25 分钟
  9. 9

    Stopwatch Timer

    构建 stopwatch 使用开始, 停止, and reset buttons using setInterval. 练习 timers, 状态 management, and 时间格式化.

    简单 约 20 分钟
  10. 10

    Bar Chart 数据 Visualization

    构建简单 bar chart 从数组的 数据 using DOM 元素. 练习数组 iteration, 动态元素 creation, and CSS 样式从 JavaScript.

    中等 约 25 分钟
  11. 11

    Promise 链式工作流

    使用 Promise 链构建多步数据流水线——获取用户、获取帖子、用评论增强。练习 then、catch、finally 和 Promise.all。

    中等 约 35 分钟
  12. 12

    Async/Await 数据获取器

    用 async/await 和 try/catch 重建 Promise 流水线。练习现代语法、用 Promise.all 并发获取和重试包装器。

    中等 约 35 分钟
  13. 13

    自定义事件发射器

    从零构建发布/订阅事件发射器——on、off、emit、once。练习 Node EventEmitter 和 DOM 事件系统背后的模式。

    中等 约 35 分钟
  14. 14

    有限状态机

    为旋转门或交通灯实现一个有限状态机(FSM)。练习状态转换、守卫和用于 UI 与游戏的状态模式。

    中等 约 40 分钟
  15. 15

    迷你模块系统

    设计并实现一个迷你 ES 模块加载器——define、require 和依赖解析。这是一个理解模块系统底层原理的开放性项目。

    中等 约 50 分钟