[RACE DAY] - consolelog (' $ { }') is not recognize?

Hello,
I am stuck with the expression

if(early && age > 18){
console.log(‘race will begin at 90:30am, your race number is : ${raceNumber}’);
}

It’s seems that {raceNumber} is considered as string itsself without refering to the const so console.log print 'race will begin at 90:30am, your race number is : {raceNumber}’
instead of for exemple
‘race will begin at 90:30am, your race number is : 1082}’

i have to write :

if(early && age > 18){
console.log(‘race will begin at 90:30am, your race number is :’ + raceNumber );
}

Maybe I use any old JS version ?:thinking:

Thanks for your help !:blush:

you are right that template literals are a relative new feature, but already since 2015 so your software needs to be hopelessly outdated for template literals not to work

template literals only work when the string is enclosed in backticks/grave-accent.

1 Like