Skip to content

Instantly share code, notes, and snippets.

@brandonbloom
Last active July 29, 2017 20:39
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 brandonbloom/19449fcdfb1c4b34c8c3d1fd39a4e203 to your computer and use it in GitHub Desktop.
Save brandonbloom/19449fcdfb1c4b34c8c3d1fd39a4e203 to your computer and use it in GitHub Desktop.
let steps = [[0, t => t * 2], [0.5, t => t * 5]];
let x;
for (let i = 0; i < steps.length; i++) {
let [k, f] = steps[i];
if (k <= t) {
x = f(t);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment