Skip to content

Instantly share code, notes, and snippets.

@AppMkrATL
Created February 13, 2018 13:19
Show Gist options
  • Save AppMkrATL/a4fad73aa9aa26a1168d426c179a9e88 to your computer and use it in GitHub Desktop.
Save AppMkrATL/a4fad73aa9aa26a1168d426c179a9e88 to your computer and use it in GitHub Desktop.
String drills
function add(num1, num2) {
return num1 + num2;
}
function subtract(num1, num2) {
return num1 - num2;
}
function testAdd() {
const num1 = 5;
const num2 = 10;
const expected = 15;
if (add(num1, num2) === expected) {
console.log('SUCCESS: `testAdd` is working');
return true;
}
else {
console.log('FAILURE: `testAdd` is not working');
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment