Interpolation v. Concatenation
Mon Nov 01 2021 20:20:30 GMT+0000 (Coordinated Universal Time)
Saved by
@bronxrock
const myString = 'template literal';
const myNumber = 10;
const myBoolean = false;
`Saying that interpolation with ${myString}s is better than concatenation ${90 + myNumber}% of the time is simply ${myBoolean}. But it is pretty cool!
Beware that new lines inside of a ${myString} will be preserved as new lines in the resulting ${typeof myString}!`;
//=> "Saying that interpolation with template literals is better than concatenation 100% of the time is simply false. But it is pretty cool!
// Beware that new lines inside of a template literal will be preserved as new lines in the resulting string!"
content_copyCOPY
https://learning.flatironschool.com/courses/4608/assignments/149885?module_item_id
Comments