当前位置:网站首页>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 :
边栏推荐
- The FISCO bcos console calls the contract and reports an error does not exist
- [prefix and notes] prefix and introduction and use
- [dynamic programming] leetcode 53: maximum subarray sum
- It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
- 技术实践|线上故障分析及解决方法(上)
- In the process of seeking human intelligent AI, meta bet on self supervised learning
- The difference between fetchtype lazy and eagle in JPA
- Stringutils and collectionutils
- Regular expression of shell script value
- It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
猜你喜欢
Conditional test, if, case conditional test statements of shell script
0 basic learning C language - nixie tube dynamic scanning display
1-Redis架构设计到使用场景-四种部署运行模式(上)
Future源码一观-JUC系列
在寻求人类智能AI的过程中,Meta将赌注押向了自监督学习
我管你什么okr还是kpi,PPT轻松交给你
[common error] custom IP instantiation error
A dichotomy of Valentine's Day
@EnableAsync @Async
MySQL - use of aggregate functions and group by groups
随机推荐
不得不会的Oracle数据库知识点(三)
Analysis and solution of lazyinitializationexception
The force deduction method summarizes the single elements in the 540 ordered array
Function: find the sum of the elements on the main and sub diagonal of the matrix with 5 rows and 5 columns. Note that the elements where the two diagonals intersect are added only once. For example,
Future source code view -juc series
Gee: create a new feature and set corresponding attributes
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
C import Xls data method summary IV (upload file de duplication and database data De duplication)
Beijing invites reporters and media
MySQL - use of aggregate functions and group by groups
【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示
Infiltration learning diary day19
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading
Flutter local database sqflite
Typescript basic knowledge sorting
Swagger2 quick start and use
Who moved my code!
使用dnSpy对无源码EXE或DLL进行反编译并且修改
功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。
GUI application: socket network chat room