飞道的博客

删除对象的某个属性值

313人阅读  评论(0)

使用 delete obj.name

	var drr = [
       {
           DocEsopDrawingId: "7c72a6e4-677d-465a-aa65-24949e5f7d5a",
           DocEsopDrawingCode: "a24",
           Process: "test1",
           CustomerName: "通用",
           ModelName: "G6-Sycom(35-102-0000199 200)",
           Type: "null(1页/秒)",
           Category: "量产",
           Operate:'<div>'
       },
       {
           DocEsopDrawingId: "2135df72-0c8a-484b-8354-8954bb99b814",
           DocEsopDrawingCode: "a31",
           Process: "test1",
           CustomerName: "通用",
           ModelName: "G6-Sycom(35-102-0000199 200)",
           Type: "null(21页/秒)",
           Category: "试产",
           Operate:'<div>'
       }
   ];
   for(var i=drr.length-1;i>=0;i--){
     delete drr[i].Operate;   //敲重点
   }
   console.log(drr)

结果如下:


转载:https://blog.csdn.net/nnaay_/article/details/104679271
查看评论
* 以上用户言论只代表其个人观点,不代表本网站的观点或立场