What is wrong with my Javascript code?

I am learning Javascript and thought we would make myself a plan to get the roots connected with parabolas.Nonetheless, when POST press that button to calculate the particular roots, the alert which should pop in place doesn’t POST cant find out what’s wrong with the code.Aid!

Here is the Value:

You get several difficulties here.

ONE PARTICULAR.Take a glance at this line:

function=Define_Variables()

That = shouldn’t be there.It needs to be a breathing space.

A COUPLE OF.JavaScript is not algebra.You’ll want to use that * owner to flourish things.

SEVERAL.JavaScript variables and capabilities are case-sensitive.The perform you’re wanting to use for computing your square actual is Instructional math.sqrt(), not math.sqrt().

4.The owner doesn’t carry out what you think it can.Use that Math.pow() perform to raise lots to a power.

5.Always set a semicolon at the end of every statement.This may not be strictly essential in JavaScript, nonetheless it’s good practice.

6TH.To mix strings (like you are doing within your alert() statement) you’ll want to use the particular + owner.For case in point:

alert(“The sources are ” + ((term1 + term2) / term3) + ” in addition to ” + ((term1 :term2) / term3));

You get many blunders, including:
:math.sqrt needs to be Math.sqrt
– concatenation is conducted with any + which is missing in the alert
– within your alert, you simply must put that calculation concerning parentheses

You should use a browser which has a good javascript debugging console like Opera.

Leave a Reply