Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Last active October 16, 2015 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamcameron/4844026b3ecfe8fa2a15 to your computer and use it in GitHub Desktop.
Save adamcameron/4844026b3ecfe8fa2a15 to your computer and use it in GitHub Desktop.
<cfscript>
function nextIds(ids, id, count){
var thisIdIdx = ids.find(id);
var idsLen = ids.len();
if (thisIdIdx == 0 || thisIdIdx == idsLen){
return [];
}
return ids.slice(thisIdIdx+1, min(idsLen-thisIdIdx, count));
}
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment