示例#1
0
        public static bool Remove <T>(JsArray <T> list, T item) where T : class
        {
            var index = IndexOf(list, item);

            if (index >= 0)
            {
                list.splice(index, 1);
                return(true);
            }
            return(false);
        }
示例#2
0
 public static JsNumber Remove <T>(this JsArray <T> list, T item) where T : class
 {
     for (var i = 0; i < list.length; i++)
     {
         if (list[i] == item)
         {
             list.splice(i, 1);
             return(i);
         }
     }
     return(-1);
 }
示例#3
0
 public static void Clear <T>(this JsArray <T> list) where T : class
 {
     list.splice(0, list.length);
 }
示例#4
0
 public static void Insert <T>(this JsArray <T> list, JsNumber index, T item) where T : class
 {
     list.splice(index, 0, item);
 }