当前位置:网站首页>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 :


边栏推荐
- Introduction to unity shader essentials reading notes Chapter III unity shader Foundation
- Gauss elimination method and template code
- Analysis and solution of lazyinitializationexception
- C import Xls data method summary V (complete code)
- Mongodb learning notes: command line tools
- 不得不会的Oracle数据库知识点(三)
- Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".
- Function: write function fun to find s=1^k+2^k +3^k ++ The value of n^k, (the cumulative sum of the K power of 1 to the K power of n).
- It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
- Force deduction solution summary 1189- maximum number of "balloons"
猜你喜欢

Function: write function fun to find s=1^k+2^k +3^k ++ The value of n^k, (the cumulative sum of the K power of 1 to the K power of n).

Function: store the strings entered in the main function in reverse order. For example, if you input the string "ABCDEFG", you should output "gfedcba".

Long article review: entropy, free energy, symmetry and dynamics in the brain

Unity Shader入门精要读书笔记 第三章 Unity Shader基础

查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题

Future source code view -juc series

Introduction to unity shader essentials reading notes Chapter III unity shader Foundation

功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
![Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading](/img/d2/99932660298b4a4cddd7e5e69faca1.png)
Cesiumjs 2022^ source code interpretation [8] - resource encapsulation and multithreading

How to delete MySQL components using xshell7?
随机推荐
功能:编写函数fun求s=1^k+2^k +3^k + ......+N^k的值, (1的K次方到N的K次方的累加和)。
HackTheBox-baby breaking grad
[common error] UART cannot receive data error
Fundamentals of machine learning: feature selection with lasso
The FISCO bcos console calls the contract and reports an error does not exist
C import Xls data method summary I (upload files and create Workbooks)
MPLS experiment
Summary of common tools and technical points of PMP examination
Introduction to unity shader essentials reading notes Chapter III unity shader Foundation
PMP 考试常见工具与技术点总结
Who moved my code!
Technical practice online fault analysis and solutions (Part 1)
What insurance products should be bought for the elderly?
不得不会的Oracle数据库知识点(二)
Functions and arrays of shell scripts
[prefix and notes] prefix and introduction and use
Query efficiency increased by 10 times! Three optimization schemes to help you solve the deep paging problem of MySQL
2-Redis架构设计到使用场景-四种部署运行模式(下)
不得不会的Oracle数据库知识点(三)
不得不会的Oracle数据库知识点(一)