/introduction

Exercise for creating and using variables, and logging a message to the console.

Primary LanguageJavaScriptISC LicenseISC

"Introduction" Exercise

Join the chat at https://gitter.im/unioncollege-webtech/introduction

In this exercise, we will use variables, strings, arrays, and console.log to log an introduction message.

Description

Update introduction.js, adding code which does the following:

  1. Create a new variable name, and set its value equal to a String containing your first and last name (e.g. Benjamin Barber).

  2. Create a new variable age, and set its value equal to a Number representing your age in years (e.g. 33).

  3. Create a new variable major, and set its value equal to a String representing your major(s) (e.g. Computing).

  4. Create a new variable classStanding, and set its value equal to an Array containing the following five (5) values: "Freshman", "Sophomore", "Junior", "Senior", "Alumnus".

  5. 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.

  6. 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.

Testing (experimental)

If you want to test your code as you are going along, you can run this command:

node test

Completing and submitting 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.

References