hands-on lab

JavaScript Primitive Data Type Variables and Console Log

Difficulty: Beginner
Duration: Up to 40 minutes
Students: 1,644
Rating: 3.9/5
On average, students complete this lab in10m
Get guided in a real environmentPractice with a step-by-step scenario in a real, provisioned environment.
Learn and validateUse validations to check your solutions every step of the way.
See resultsTrack your knowledge and monitor your progress.

Description

In programming, variables are named containers for the purpose of storing data. This value may or may not change depending on the type of variable and the conditions set forth by the program's instructions (code).

console.log() is a function that prints a message to the JavaScript console. The message printed is dependent on what is passed through as an argument inside of the parentheses.

In this lab, you are to declare variables of different primitive types. Then output each variable's value in the console.

Learning Objectives

Upon completion of this lab, you will be able to:

  • Declare variables of different primitive data types
  • Use console.log() to output the variable's value to the console

Intended Audience

  • Beginners learning front-end development
  • Software Engineers who need to learn front-end technologies to expand their skill set

Prerequisites

The following courses and labs can ensure your success:

Covered topics

Hands-on Lab UUID

Lab steps

0 of 7 steps completed.Use arrow keys to navigate between steps. Press Enter to go to a step if available.
  1. Introduction to JavaScript Labs
  2. Declare a string variable
  3. Display string in the console
  4. Declare a boolean variable
  5. Display boolean in the console
  6. Declare a number variable
  7. Display number in console