Skip to content

Instantly share code, notes, and snippets.

@mhawksey
Created October 9, 2012 15:23
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mhawksey/3859495 to your computer and use it in GitHub Desktop.
Replace question ids with answer ids
function getReplies(sourceArray, replyArray){
var output= [];
for (i in sourceArray){
output.push([alltrim(sourceArray[i][0])]);
for (j in replyArray){
if (alltrim(sourceArray[i][0])==replyArray[j][1]) {
output.pop();
output.push([replyArray[j][0]]);
}
}
}
return output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment