Skip to content

Instantly share code, notes, and snippets.

@P0lip
Created May 2, 2017 11:14
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 P0lip/9290aabe6cc4db0feffa89fdd05b826b to your computer and use it in GitHub Desktop.
Save P0lip/9290aabe6cc4db0feffa89fdd05b826b to your computer and use it in GitHub Desktop.
let secondIndex = 0;
function elemAtComplex(arr, index) {
return arr[secondIndex + index];
}
elemAtComplex(['v8 ',' is',' awesome'], 0);
secondIndex++;
elemAtComplex(['netguru ',' loves',' Node.js'], 1);
secondIndex++;
%OptimizeFunctionOnNextCall(elemAtComplex);
elemAtComplex(['wooo','dooo','dooboo'], 0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment