Interactive tutorial

JavaScript Basics: Variables, Data Types, and Operators

Learn to create and update variables, recognize common JavaScript data types, and use arithmetic, comparison, and logical operators. Practice in your own browser console, avoid common type-conversion mistakes, and finish by calculating a shopping total and checking eligibility for an offer.

  • Level: Beginner
  • Duration: approx. 36 min
  • 9 steps
JavaScript Basics: Variables, Data Types, and Operators

What you will go through

  1. Step 1 of 9 3 min Recognize Values and Display Output Recognize number, string, and Boolean literals, then use the browser Console to display values and distinguish printed Output from a separate evaluation display.
  2. Step 2 of 9 4 min Store and Update Values with const and let Use const for fixed bindings, let for planned updates, and distinguish declarations from later reassignments.
  3. Step 3 of 9 4 min Inspect Types and Recognize Missing Values Inspect JavaScript type descriptions and distinguish undefined, null, and undeclared names.
  4. Step 4 of 9 5 min Calculate with Arithmetic Operators Build numeric expressions, control grouping with parentheses, and update a changing value with compound assignment.
  5. Step 5 of 9 4 min Build Strings and Readable Messages Use `+` for numeric addition or string concatenation, then create a readable shopping message with a template literal.
  6. Step 6 of 9 4 min Convert Types Deliberately Convert numeric text intentionally, inspect failed conversions, and avoid surprising results caused by implicit conversion.
  7. Step 7 of 9 4 min Compare Values and Test Thresholds Use strict equality and numeric relational operators to compare values and test a shopping threshold precisely.
  8. Step 8 of 9 4 min Combine Conditions with Logical Operators Use AND, OR, and NOT to express a shopping-offer rule and evaluate Boolean conditions.
  9. Step 9 of 9 6 min Apply It All: Shopping Total and Eligibility Complete and verify an integrated shopping calculation in your own browser Console.

Video Courses

Courses related to this topic

See all video courses

Download the App now to have access to + 5000 free courses, exercises, certificates and lots of content without paying anything!

  • 100% free online courses from start to finish

    Thousands of online courses in video, ebooks and audiobooks.

  • More than 60 thousand free exercises

    To test your knowledge during online courses

  • Valid free Digital Certificate with QR Code

    Generated directly from your cell phone's photo gallery and sent to your email

Cursa app on the ebook screen, the video course screen and the course exercises screen, plus the course completion certificate