> Why is this Javascript code not working?

Why is this Javascript code not working?

Posted at: 2014-12-18 
Replace the method ".writeIn" with ".writeln"

Use an L instead of an I.

Also change the method ".write" to ".writeln"

Also, when you have an issue like this hit F12 on the page, and it should open up the console. That will tell you exactly what line is erroring and what the error is.

Are you positive that is what your professor wants? It is a really bad way of doing it. You can do the entire thing with two variables.



Basically what I did here is I created a function and called it convert. The name is irrelevant as long as it isn't a name that makes JavaScript cranky. It should make sense though so name it something logical that describes the action it does.

By saying function convert(inches) I am basically telling JavaScript that I am going to pass it the number of inches when I call it. This lets me type convert(2); convert(5); convert(10); or any other number I care to pass onto it to get converted. That number gets stored as the variable inches as far as that function is concerned so inside the function I can say "inches * 25.4" and it will convert any number I throw in there and spit it out onto the screen using document.writeln(). I used
tags to make it easier to read.

you can use document.write or document.writeln (it's an L, not a i )

I'm trying to complete a Javascript homework assignment where we have to convert 2, 5, and 10 inches to millimeters. This is my first assignment in Javascript so I really don't know what I'm doing. The professor wants us to store everything in variables, so I thought I set everything up correctly... but when I try and load the page, nothing shows up. Can anyone see what the problem is and maybe explain it to me? I just want to know what I am doing wrong. Thank you!!!