Skip to content

Instantly share code, notes, and snippets.

@ramsunvtech
Created September 25, 2018 20:11
Show Gist options
  • Save ramsunvtech/52a6a1e2776d4e34e79413a11c56c10b to your computer and use it in GitHub Desktop.
Save ramsunvtech/52a6a1e2776d4e34e79413a11c56c10b to your computer and use it in GitHub Desktop.
Divide without Slash Symbol
function divideByMinus (a, b) {
var i = 0;
while(a >= b) {
i++;
a = a - b;
}
return i;
}
divideByMinus(10, 2); // 5
divideByMinus(10, 3); // 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment