Evan You 12 years ago
parent
commit
dde0bc8d41
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/observer/array-augmentations.js

+ 3 - 0
src/observer/array-augmentations.js

@@ -102,6 +102,9 @@ _.define(arrayAugmentations, '$set', function (index, val) {
  */
 
 _.define(arrayAugmentations, '$remove', function (index) {
+  if (typeof index !== 'number') {
+    index = this.indexOf(index)
+  }
   if (index > -1) {
     return this.splice(index, 1)[0]
   }