A check-in record has text, a number, and a true/false flag. Compare the types before formatting a summary.
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.
const petName = "Nori";
const petAge = 2;
const isAdopted = false;
console.log(typeof petName, typeof petAge, typeof isAdopted);
studentName to "Mia"; the provided probe will log name: Mia (string).studentAge to 14; the provided probe will log age: 14 (number).isStudent to true; the provided probe will log student: true (boolean).Mia:string | 14:number | true:boolean on its own line.Use a string for the name, a number for the age, and a boolean for the student flag.
Use typeof value to get the type label for each variable.