- slide 1 of 3
- slide 2 of 3
-------Code Begins Here-------
var word1 = "apples"
var word2 = "oranges"
var word3 = "grapes"
var word4 = "melons"
var word5 = "FRUIT"
document.write("<p>", word1 + word2 + word3 + word4, "<br />")
document.write(word1.toUpperCase(), "<br />")
document.write(word2.blink(), "<br />")
document.write(word3.bold(), "<br />")
var salary = parseInt(prompt("Please enter your hourly salary without the dollar sign", ""))
-------Code Ends Here-------
In my first document.write statement all I'm doing is concatenating strings, in other words, I'm "stringing" them together without spaces in this example. I didn't have to declare variables; but, that's how I prefer to work. The second line to print involves taking the string stored in the word1 variable to upper case letters using the toUpperCase() method. I could just have easily used this method directly on a string "caught up" within the document.write statement by writing: document.write("apples".toUpperCase().