Data Types
Data Types
a) Object
b) String
c) Symbol
d) Boolean
4. WHAT IS THE RESULT OF ADDING A
NUMBER AND A STRING IN JAVASCRIPT?
a) BigInt
b) Number
c) Symbol
d) Float
6. WHICH OF THE FOLLOWING CORRECTLY
DECLARES A BOOLEAN VARIABLE?
//String
let name = "Alice";
// Number
let age = 25;
// Boolean
let isStudent = true;
// Null
let middleName = null;
HERE'S AN EXAMPLE OF SIMPLE JAVASCRIPT CODE THAT
DECLARES VARIABLES USING BASIC DATA TYPES:
//Undefined
let nickname;
// Object
let person = { firstName: "Alice", lastName: "Smith",
age: 25};
// Array
let favoriteColors = ["blue", "green", "red"];
// BigInt
let bigNumber = 123456789012345678901234567890n;
// Symbol
let uniqueId = Symbol("id");
// Logging variables to the console
console.log("Name:", name);
console.log("Age:", age);
console.log("Is Student:", isStudent);
console.log("Middle Name:", middleName);
console.log("Nickname:", nickname);
console.log("Person:", person);
console.log("Favorite Colors:", favoriteColors);
console.log("Big Number:", bigNumber);
console.log("Unique ID:", uniqueId);
APPRECIATE THE IMPORTANCE OF CORRECTLY
USING DATA TYPES IN PROGRAMMING.