Created
July 5, 2012 06:33
List join imperative
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var f = function (l) { | |
var paired = [], | |
previous = 0; | |
for (var i = 1; i < l.length; i++) { | |
paired.push([l[previous], l[i]]); | |
previous++; | |
} | |
paired.push([previous,0]); | |
return paired; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment