Is it unnecessary to use the extension operator in the js code of Ant Design Mobile?

Is it unnecessary for the js code of

Ant Design Mobile to use the extension operator? This is the assignment in the red box below.

clipboard.png

:
sectionIDspush

:
Ant Design Mobile"TabBar" :
https://antd-mobile.gitee.io/...

clipboard.png

Dec.11,2021

update: the rapid development of web in the past two years has spawned a concept called immutable , and there is even a special library called immutable.js , which may seem useless, but it is actually very useful. Using the [. []] method is also a small immutable transformation. It is often used when redux and react work together.

< hr >

this is a new array, a reference that is broken from the previous array, and the main purpose is to break the reference to avoid being accidentally modified.


if some frames are used, the global variable just push may not trigger the re-rendering of the page, which is guaranteed by the extension operator. I've been in this situation before when I'm working on a project.

Menu