Skip to content

Commit

Permalink
add remove function
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony MOI committed May 1, 2012
1 parent 4eef67b commit 0b11bc2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cell-0.3.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions src/base.js
Expand Up @@ -153,6 +153,19 @@ CELL.log = function() {
return console.log.apply(console, arguments);
};

/**
* remove(e)
* Removes the element e from the Array, using the JS '===' equality
*/
CELL.remove = function(that, e) {
"use strict";

if(that === void 0 || that === null || !Array.isArray(that))
throw new TypeError();

for(var i = that.length - 1; i >= 0; i--)
if(e === that[i]) that.splice(i, 1);
};

CELL.DEBUG = false;

Expand Down

0 comments on commit 0b11bc2

Please sign in to comment.