I have a string in my JS code that I want to include three parts, each rendered conditionally.
let a = `
${condition1 ? <text1> : ""}
${condition2 ? <text2> : ""}
${condition3 ? <text3> : ""}
`
I want a to be all on one line, but this renders on multiple lines. The reason I wrote the code on multiple lines is for ease of reading.
Is there a way to write the code on multiple lines but have the string render on one?
Avoid template string literals
Example: