Skip to content

Commit

Permalink
Merge pull request JS-Challenges#29 from mybrainishuge/master
Browse files Browse the repository at this point in the history
Changed 'sum' prompt to return 0 for empty array
  • Loading branch information
mybrainishuge committed Mar 28, 2016
2 parents 2211d92 + dfd7496 commit e16ec5b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/part1.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
expect(sum([3,0,-34,-7,18])).to.eql(-20);
});

it('should return undefined for an empty array', function() {
expect(sum([])).to.eql(undefined);
it('should return 0 for empty array', function() {
expect(sum([])).to.eql(0);
});

it('should accept an array with a single integer', function() {
Expand Down

0 comments on commit e16ec5b

Please sign in to comment.