There are different methods we can use for outputting data using JavaScript.
The first we'll explore is the document dot right method let's take a look at an example to see how
this works in this HMO page.
We have a script that will display the result of a simple calculation using document dot rate.
You can see here we have two values and we want to add them together five plus six.
The result of this equation will be displayed in the content area of our web browser because we have
attached the document dot right function next to it.
So here's the web browser and we can see that the results are displayed beneath this line of text.
So if we were to change the equation and save our file it would update the value.
And so it's that simple that's how the document rate function works.
Another method of outputting data is the window alert.
This method will output the data in a pop up message box.
So let's replace the document dot right with window dot alert and see the difference.
So now we can see that we get a pop up message box with the value 13.