r/javaScriptStudyGroup • u/ForScale • May 10 '16
CHALLENGE: Write a multiplication function...
CHALLENGE:
Write a multiplication function that takes two numbers integers as arguments and returns their product.
Rules:
Cannot use
*or/operatorsCannot use Math object
Cannot use for (any variation) or while (including do) loops
2
Upvotes
1
u/Volv May 10 '16
Ternary is fairly common for simple if then else when all you are doing is assigning values. That one is nested but I think formatted in such a way that it is obvious enough without being too hard to read?
versus