当前位置:网站首页>ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
ES6 deletes an attribute in all array objects through map, deconstruction and extension operators
2022-07-04 01:18:00 【Programmer base camp】
First of all, demand
There are two drop-down boxes in a form , All access the same interface to get the tree structure List Data is dynamically bound to their respective drop-down boxes , The difference lies in A The drop-down box shows only the root node ,B The drop-down box displays all the data of the tree structure .
For performance reasons , The front end must only send one ajax request , The back end only writes one acquisition TreeList Interface of structure , It is used to meet the dynamic assignment of two drop-down boxes .
Pictured : The left figure shows the root node item , The right figure shows all tree structure items
Paste the returned data structure
Ideas : From the perspective of data structure, it contains all the root node and child node data treeList Array objects .B The drop-down box can be assigned unchanged ,A The drop-down box needs to put children Attribute is deleted .
Here are a few knowledge points : Deep copy ,map、 Deconstruction and extension operators adopt ES6 The syntax of is elegant to delete the attributes in the array
Post code directly :
Finally, the root node data printed is compared as follows :
边栏推荐
- 1-Redis架构设计到使用场景-四种部署运行模式(上)
- In the process of seeking human intelligent AI, meta bet on self supervised learning
- 老姜的特点
- Some other configurations on Huawei's spanning tree
- Introduction to unity shader essentials reading notes Chapter III unity shader Foundation
- 12. Go implementation of integer to Roman numeral and leetcode
- The first training of wechat applet
- Since the "epidemic", we have adhered to the "no closing" of data middle office services
- Functions and arrays of shell scripts
- gslb(global server load balance)技术的一点理解
猜你喜欢
功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。
MPLS experiment
Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
【.NET+MQTT】. Net6 environment to achieve mqtt communication, as well as bilateral message subscription and publishing code demonstration of server and client
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
MySQL - use of aggregate functions and group by groups
Future source code view -juc series
String hash, find the string hash value after deleting any character, double hash
随机推荐
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading
MySQL uses the view to report an error, explain/show can not be issued; lacking privileges for underlying table
The force deduction method summarizes the single elements in the 540 ordered array
About uintptr_ T and IntPtr_ T type
Install the pit that the electron has stepped on
Analysis and solution of lazyinitializationexception
How to use AHAS to ensure the stability of Web services?
Huawei rip and BFD linkage
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
“疫”起坚守 保障数据中台服务“不打烊”
Wechat official account and synchronization assistant
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
Typescript basic knowledge sorting
mysql使用视图报错,EXPLAIN/SHOW can not be issued; lacking privileges for underlying table
Gnupg website
be based on. NETCORE development blog project starblog - (14) realize theme switching function
gslb(global server load balance)技术的一点理解
The culprit of unrestrained consumption -- Summary
C import Xls data method summary IV (upload file de duplication and database data De duplication)
The first training of wechat applet