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


边栏推荐
- About uintptr_ T and IntPtr_ T type
- be based on. NETCORE development blog project starblog - (14) realize theme switching function
- The FISCO bcos console calls the contract and reports an error does not exist
- 51 MCU external interrupt
- A malware detection method for checking PLC system using satisfiability modulus theoretical model
- GUI application: socket network chat room
- Windos10 reinstallation system tutorial
- Understanding of Radix
- Summary of common tools and technical points of PMP examination
- A little understanding of GSLB (global server load balance) technology
猜你喜欢

Huawei rip and BFD linkage

MySQL - use of aggregate functions and group by groups

How to use AHAS to ensure the stability of Web services?

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

How to set the response description information when the response parameter in swagger is Boolean or integer

在寻求人类智能AI的过程中,Meta将赌注押向了自监督学习

【.NET+MQTT】.NET6 环境下实现MQTT通信,以及服务端、客户端的双边消息订阅与发布的代码演示

What is the GPM scheduler for go?

Luogu p1309 Swiss wheel

功能:求5行5列矩阵的主、副对角线上元素之和。注意, 两条对角线相交的元素只加一次。例如:主函数中给出的矩阵的两条对角线的和为45。
随机推荐
C import Xls data method summary IV (upload file de duplication and database data De duplication)
MySQL - use of aggregate functions and group by groups
不得不会的Oracle数据库知识点(三)
求esp32C3板子连接mssql方法
All in one 1407: stupid monkey
Characteristics of ginger
be based on. NETCORE development blog project starblog - (14) realize theme switching function
Functions and arrays of shell scripts
基于.NetCore开发博客项目 StarBlog - (14) 实现主题切换功能
查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题
be based on. NETCORE development blog project starblog - (14) realize theme switching function
Unity Shader入门精要读书笔记 第三章 Unity Shader基础
数据库表外键的设计
关于 uintptr_t和intptr_t 类型
Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience
@EnableAsync @Async
It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
删除所有值为y的元素。数组元素中的值和y的值由主函数通过键盘输入。
Pratique technique | analyse et solution des défaillances en ligne (Partie 1)
Summary of JWT related knowledge