How to use `typeof` when concatenating two data types?

The above statement is incorrect.
You can try this:
console.log(typeof ‘My cat is called {catName} and she is {catAge} years old. Ive just concatenated this string using variables of different data types.’);

The result is string because JavaScript will convert all the data to a string during execution.

let word = ‘Coffee’;

let number = 3;

console.log(‘I drink ’ + number + ’ cups of ’ + word + ’ a day’);

// Prints: I drink 3 cups of coffee a day.

To be able to use typeof when concatenating variables containing two different data types:

  1. Create the first variable (e.g. foo1)
  2. Set foo1 to a string value (e.g. "bar")
  3. Create the second variable (e.g. foo2)
  4. Set foo2 to a number value (e.g. 7)
  5. Store the concentration in a new variable (e.g. foo3)
  6. use typeof on the newly created variable (i.e. foo3)

As so

let name = "John"; // type = string
let age = 25; // type = number
let combined = name + age; 

console.log(typeof name); // => string
console.log(typeof age); // => number
console.log(typeof combined); // => string