Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (15 sloc) 920 Bytes

Front-end Web Development

Assignment for Week 4

  1. Create an HTML file (a blank file with a .html extension).
  2. Create a JS file (a blank file with a .js extension).
  3. Add a <script> tag to the HTML file. Set its src attribute to the name of your JS file.
  4. In the JS file, declare a variable called x.
  5. Assign the number 1000 as the value of x.
  6. Declare a variable called y and assign the number 234 as its value.
  7. Declare a variable called sum and assign it the sum of x and y (JavaScript should do this math, not you).
  8. Declare a variable called message and assign it a string that says, in sentence form, what the sum is (concatenation is necessary).
  9. Use the alert DOM function to show the message to the user.

Extra credit:

  • Redo the above without declaring any variables.

Solution

You can’t perform that action at this time.