web/data/cubicweb.js
changeset 7649 ede740bd7077
parent 7284 a474cb989546
child 7831 6af00dbfaadd
--- a/web/data/cubicweb.js	Mon Jul 11 19:48:37 2011 +0200
+++ b/web/data/cubicweb.js	Tue Jul 12 10:36:22 2011 +0200
@@ -318,6 +318,17 @@
         }
     },
 
+
+    /**
+     * .. function:: extend(array1, array2)
+     *
+     * equivalent of python ``+=`` statement on lists (array1 += array2)
+     */
+    extend: function(array1, array2) {
+        array1.push.apply(array1, array2);
+        return array1; // return array1 for convenience
+    },
+
     /**
      * .. function:: difference(lst1, lst2)
      *