0
for (let email of CONTACT_EMAIL_ARRAY) {
        console.log('found contact : ${email}');
        } 

In source textbook, console output is::::: found contact: example mail 1, 2, 3 etc.

When I try it locally it just says : found contact : ${email}

Every time I use console log with a dollar sign ::: output is the same

What is missing?

botlirajj
  • 3
  • 2

1 Answers1

1

You're trying to use a template literal string interpolation. The syntax for those uses the backtick (`) character instead of a quotation mark (' or "):

const CONTACT_EMAIL_ARRAY = ["Jonathan (a@b.c)", "David (b@c.d)"]

for (const email of CONTACT_EMAIL_ARRAY) {
  console.log(`found contact : ${email}`);
  // note the usage of ` instead of ' ^^^
} 
Jacob
  • 1,577
  • 8
  • 24