Coursera 笔记

Module 02 · Understanding Function Components with Array and DOM Manipulation函数组件、数组与 DOM 操作

Lesson 2 Summary: Array in React and DOM Manipulation第 2 课总结:React 中的数组与 DOM 操作

Coursera ↗

Congratulations! You have completed this lesson. At this point in the course, you know that:
恭喜!你已经完成了这个课程。在这个课程阶段,你知道:

  • You use the array data structures often to store groups of items in a single variable.
    您经常使用数组数据结构来在单个变量中存储项目组。
  • Two important array methods include:
    两个重要的数组方法包括:
    • map(), which makes it easier to make new arrays by applying a function to each element
      map(),它通过将函数应用于每个元素来简化创建新数组的过程
    • forEach(), which runs a function on each array element without creating a new array
      forEach(),在数组的每个元素上运行一个函数而不创建新数组
  • The DOM allows access to and dynamically manipulates web documents’ content, structure, and style.
    DOM 允许访问和动态操作网页文档的内容、结构和样式。
  • React's virtual DOM abstracts the actual DOM implemented in memory and keeps the virtual DOM in sync with the real DOM by React’s reconciliation process.
    React 的虚拟 DOM 抽象了内存中实现的实际 DOM,并通过 React 的协调过程保持虚拟 DOM 与真实 DOM 的同步。
  • React’s virtual DOM updates only the necessary parts of the DOM, improving the application's performance, especially in scenarios where only specific components or elements need to be updated.
    React 的虚拟 DOM 只更新 DOM 的必要部分,从而提高应用程序的性能,尤其是在只需要更新特定组件或元素的场景中。