Solution to 99 lisp problems: P08, with functional javascriptIf a list contains repeated elements they should be replaced with a single copy of the element. The order of the elements should not be changed.* (compress '(a a a a b c c a a d e e e e))  (A B C A D E)Anyone want to review?function cond( check, _then, _continuation ) {  if(check) return _then( _continuation )  else return _continuation()}function compress( list ) {  return (function check( index, item, nextItem, compressed ) {    return cond( item !== nextItem, function _then( continuation ) {        compressed = compressed.concat([ item ])        return continuation()      },    function _continueation() {      return cond(!nextItem, function _then() {          return compressed      },       function _continuation() {          return check( index + 1, list[index + 1], list[index + 2], compressed )        })    })  })( 0, list[0], list[1], [] )}ref: http://www.ic.unicamp.br/~meidanis/courses/mc336/2006s2/funcional/L-99_Ninety-Nine_Lisp_Problems.html
Solution to 99 lisp problems: P08 with functional javascript
javascript;lisp;functional programming