Skip to content

Instantly share code, notes, and snippets.

@yortuc
Created February 28, 2015 17:34
Show Gist options
  • Save yortuc/c3f6faf4acb124e0f953 to your computer and use it in GitHub Desktop.
Save yortuc/c3f6faf4acb124e0f953 to your computer and use it in GitHub Desktop.
List veriyapısı
var List = function(){
this.data = [];
this.add = add;
this.remove = remove;
this.count = count;
}
function add(item){
this.data.push(item);
}
function remove(item){
for(var i = 0; i < this.data.length; i++){
if(this.data[i] === item){
return this.data.splice(i, 1);
}
}
}
function count(){
return this.data.length;
}
module.exports = List;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment