• in
InterCourses
CoursesBlogs
0
← Introduction to JavaScript
○What is JavaScript?○Your First JavaScript Code●Data Types○Type Checking
○Declaring Variables○let and const in Practice○Operators○Type Conversion
○Conditionals○Switch Statement○For Loops○While Loop○Break and Continue
○Defining Functions○Arrow Functions○Scope○Closures○Project - Calculator○Function Expressions
○Arrays○Array Mutation Methods○Array Search and Slice○Array Iteration Methods○Multidimensional Arrays○Destructuring○Array Reverse and Sort○Array Fill○Array Find and Includes○Array Flat and FlatMap○Array Reduce, Some, and Every
○Objects○Object Methods and Destructuring○JSON○Math and Date○Date Basics
○02 Template Literals○String Methods○Regular Expressions
○Higher-Order Functions○Callbacks○map, filter, and reduce○Recursion○Project - Data Transform Pipeline
○OOP Introduction○Classes○Inheritance○Encapsulation
○Asynchronous JavaScript○Promises and Async Await○Async API Simulation

Data Types

JavaScript values have types, and beginners need to see that a string, number, and boolean behave differently. This lesson turns that idea into a small typed summary.

Example

javascript
const name = "Mia";
const age = 14;
const isStudent = true;
console.log(typeof name, typeof age, typeof isStudent);

Your Task

  1. Create studentName, studentAge, and isStudent using the values Mia, 14, and true.
  2. Display Mia:string | 14:number | true:boolean in #output.
Hint 1
1 / 2
HINT 1

Use a string for the name, a number for the age, and a boolean for the student flag.

Loading editor…
READY
intercourses
javascript