热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

js如何将匹配到的数组元素删掉?

123456789101112131415161718192021222324252627var arr =  [  {    ServiceID: 'go-storage-127.0.0.1-808

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
var arr =  [



  {

    ServiceID: 'go-storage-127.0.0.1-8080-9090',

    ServiceName: 'storage',

    },

  {

    ServiceID: 'System-xxx-192.168.0.111-8000-8000',

    ServiceName: 'xxx',

    },

  {

    ServiceID: 'System-xxx2-192.168.0.111-8000-8000',

    ServiceName: 'xxx2',

     },

  {

    ServiceID: 'System-xxx3-192.168.0.111-8000-8000',

    ServiceName: 'xxx3',

     },

    {

        ServiceID: 'System2-xxx3-192.168.0.111-8000-8000',

        ServiceName: 'xxx3',

       },



    {

        ServiceID: 'test-xxx3-192.168.0.111-8000-8000',

        ServiceName: 'xxx3',

        }];

1
2
    将arr数组中ServiceID以test或者System开头的数组元素删掉

    用删掉的方法总是没法讲匹配到的全删,哪位高手能帮个忙呢?谢谢!



推荐阅读
author-avatar
落雪念伯言
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有