0

why this code is not working

function printTrapezoidArea([arg1,arg2,arg3]);{ let b1=parseFloat(arg1); let b2=parseFloat(arg2); let h=parsefloat(arg3); let area=(b1+b2)*h/2; console.log("TrapezoidArea = " + area); }

17th Apr 2022, 3:41 PM
Veselina Miteva
1 Answer
0
* put values as one array or 3 extra parameters, don't mix it * typo on parseFloat * remove ";" after parameters definition I added comments in my example: https://code.sololearn.com/cfuboQNe5BOF/?ref=app Please put your code in a script on playground instead of copying it into the description.
17th Apr 2022, 4:38 PM
Lisa
Lisa - avatar