Skip to content

Commit

Permalink
refactoring some library methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pbeardshear committed Jul 22, 2013
1 parent e162854 commit 63faec4
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/lib.js
Expand Up @@ -76,7 +76,7 @@ lib.capitalize = function (str) {
// Removes the element at index 'start' and places it at index 'end'
lib.move = function (array, start, end) {
var el = array.splice(start, 1)[0];
if (el) {
if (el !== undefined) {
array.splice(end, 0, el);
}
return array;
Expand Down Expand Up @@ -116,13 +116,7 @@ lib.size = function (container) {
return container.length;
}
else {
var count = 0;
for (var key in container) {
if (container.hasOwnProperty(key)) {
count += 1;
}
}
return count;
return Object.keys(container).length;
}
};

Expand Down

0 comments on commit 63faec4

Please sign in to comment.