i am starting to learn how any of this works. javaScript has been hard for me to understand the most so far, ie working the functions, if/ else etc. i am in the middle of working with helper functions at this time. since i have been having issues with it i have been playing around with it more after each section. i decide to try it with simple geometry formulas. when i went to find the area of a triangle it gave me the response of “NaN”. I remember that it stands for not a number but there is nothing but positive integers inside of the formulas. i cant find out how it is getting that response. any help would be greatly appreciated.

here is the code i used:

/* area of tirangle formula 1/2(base*height) */

function areaOfTriangle(base,height)

{ return base * height}

function newAreaOfTriangle(base,height)

{ return areaOfTriangle / 2; }

const fullArea= newAreaOfTriangle( 16, 12);

console.log(fullArea);

i followed another steps i used for the area of a semi-circle as well but that equation came out correct.

once again any help would be appreciated!!! thanks in advance