Skip to content

Instantly share code, notes, and snippets.

@KarateJB
Created April 2, 2017 02:37
Show Gist options
  • Save KarateJB/3aaa6e1edcb44390e200fd556286fc3e to your computer and use it in GitHub Desktop.
Save KarateJB/3aaa6e1edcb44390e200fd556286fc3e to your computer and use it in GitHub Desktop.
[JS] Multiple without using multiplication or addition.
function multiple(x,y){
return x/(1/y)
}
//Demo
//[1,2,3,4,5].forEach(x=>{console.log(multiple(x,8))})
//>8,16,24,32,40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment