Learn practical skills, build real-world projects, and advance your career

Assignment - JavaScript Basics Practice

In this assignment, you'll get to practice some of the concepts and skills covered in the following lessons:

  1. Variables, Operators, and Data Types
  2. Branching, Loops, and Functions
  3. Node.js Modules and Scripting

As you go through this notebook, you will find the symbol ??? in certain places. To complete this assignment, you must replace all the ??? with appropriate values, expressions or statements to ensure that the notebook runs properly end-to-end.


  1. Make sure to run all the code cells, otherwise, you may get errors like ReferenceError for undefined variables.
  2. Do not change variable names, delete cells, or disturb other existing code. It may cause problems during evaluation.
  3. Sometimes, you may need to add some code cells or new statements before or after the line of code containing the ???.
  4. Since you'll be using a free online service for code execution, save your work at regular intervals by using Ctrl-S or Command-S.
  5. Questions marked (Optional) will not be considered for evaluation, and can be skipped. They are for your learning.
  6. If you are stuck, ask for help on Slack/Discussions. Post errors, ask for hints, and help others, but please don't share the full solution, answer, or code to give others a chance to write the code themselves.
  7. After submission your code will be tested with some hidden test cases. Make sure to test your code exhaustively to cover all edge cases.
  8. If there are issues in your code, you'll receive a feedback after evaluation with a FAIL grade. You can submit your assigment multiple times until you get a PASS grade.

Problem 1 - Variables and Data Types

Q1: Assign your name to the variable name.

name = ???

Q2: Assign your age (real or fake) to the variable age.

age = ???