freeCodeCamp / wiki

freeCodeCamp's deprecated wiki articles
http://www.freecodecamp.com/wiki
281 stars 308 forks source link

Update Algorithm Chunky Monkey #1207

Closed dakshshah96 closed 8 years ago

dakshshah96 commented 8 years ago

Closes #1205.

@raisedadead: What do you think of this?

@Rafase282: Regarding the names in Credits, are there any I should remove?

ghost commented 8 years ago

LGTM :+1:

Rafase282 commented 8 years ago

Personally I think there is no much difference between the old intermediate and the new basic.

From the previous ones, the basic was the only that was different and used basic functions and iterators, the others use slice and splice that while are not the same does similar thigns and overall the code was similar.

I vote for keeping the old basic.

@dakshshah96 as for the names, these challenges have already been moved to the forum where the whole credit section has been removed as the new standard.

ghost commented 8 years ago

I agree with @Rafase282 after further scanning.

alayek commented 8 years ago

In general, I would recommend against splice() method. It alters or mutates the original array. Does not adhere to good practices of functional programming, namely, writing pure functions that always produce same outputs for same inputs.

Always use slice() over splice() when you can. Same goes for concat() vs. push().

Rafase282 commented 8 years ago

That's a good point, I didn't check that. In some challenges we are not supposed to modify the original array.