Skip to content

Instantly share code, notes, and snippets.

@helabenkhalfallah
Last active May 16, 2021 11:12
Show Gist options
  • Save helabenkhalfallah/6de1de8c2201251aaafac192659af3e2 to your computer and use it in GitHub Desktop.
Save helabenkhalfallah/6de1de8c2201251aaafac192659af3e2 to your computer and use it in GitHub Desktop.
Run To Completion Function
const doOperations = (x, y) => {
const operation1 = x + y;
console.log('operation1 : ', operation1);
const operation2 = operation1 - y;
console.log('operation2 : ', operation2);
const operation3 = (operation1 * operation2) + 2 * (x - y);
console.log('operation3 : ', operation3);
return operation3;
}
console.log('doOperations : ', doOperations(3, 2));
/*
"operation1 : ", 5
"operation2 : ", 3
"operation3 : ", 17
"doOperations : ", 17
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment