In this exercise, we will use variables, strings, arrays, and console.log to log an introduction message.
Update introduction.js, adding code which does the following:
-
Create a new variable
name
, and set its value equal to a String containing your first and last name (e.g. Benjamin Barber). -
Create a new variable
age
, and set its value equal to a Number representing your age in years (e.g. 33). -
Create a new variable
major
, and set its value equal to a String representing your major(s) (e.g. Computing). -
Create a new variable
classStanding
, and set its value equal to an Array containing the following five (5) values: "Freshman", "Sophomore", "Junior", "Senior", "Alumnus". -
Create a new variable
message
, and set its value equal to a String that is in this form:Hello! My name is <NAME>. I'm <AGE> years old, and I am a(n) <CLASS_STANDING> <MAJOR> major at Union College.
Note that
<CLASS_STANDING>
should refer to the correct array item representing your class standing. -
Log
message
to the console.
Run “introduction.js” on the server using Node.js. Review it’s output to ensure it is functioning correctly.
Run node test
to verify that all requirements are met (experimental).
Create an “introduction.html” file which includes “introduction.js”. View the Console in your browser’s Developer Tools to ensure that it is functioning correctly.
If you want to test your code as you are going along, you can run this command:
node test
- To begin, fork this repository.
- Create a new Cloud9 workspace from your new repository.
- Alternatively, you may clone your new repository to your computer.
- Modify the files and commit changes to complete your solution.
- Run
node test
to verify that all tests pass. - Push/sync the changes up to GitHub.
- Create a pull request on the original repository to turn in the assignment.
You are also welcome commit, push, and create a pull request before you’ve completed your solution. You can ask questions or request feedback there in your pull request. Just mention @barberboy
in your comments to get my attention.