can I perform multiplication without multiplication operator" * " in javascript -
i need multiply 2 numbers in javascript ,but need without multiplication operator "*".is possible?
function a(b,c){return b*c;} note:need without "*" operator
yes. because multiplication addition done multiple times. have meaningful signatures methods instead of using single alphabets.
function multiply(num, times){ // todo if times 0 // todo if times negative var n = num; for(var = 1; < times; i++) num += n; // increments return num; }
Comments
Post a Comment