When I am using
console.log("driving ${params.car} at the speed of ${params.speed}");
It is giving me result in terminal as
driving ${params.car} at the speed of ${params.speed}
Why isn't it printing the values?
When I am using
console.log("driving ${params.car} at the speed of ${params.speed}");
It is giving me result in terminal as
driving ${params.car} at the speed of ${params.speed}
Why isn't it printing the values?
Just use (`) instead of (') or (").
Note that it is a backtick, not a quote.
You have to use backquotes around the string in order for string interpolation to work.
console.log(`driving ${params.car} at the speed of ${params.speed}`);