variablesInTemplateString=`The current time is ${newDate(now)}`
htmlContent=html`<marquee><b>this will be converted to <i>HTML</i></b></marquee>`
markdownContent=md`#### This will be converted to HTML via markdown parsing
* one
* two
* three
`
svgElement=svg`<svg width=160 height=160>
<circle cx=64 cy=64 r=16></circle>
</svg>`
Let's create our own tagged template. One that returns an object with the strings and expressions passed in.
showStructure=(strings,...keys)=>{
return{
strings:strings,
keys:{
...keys
}
}
}
showStructure`I'm a string`
showStructure`I'm a string with a variable ${now}`
three=3
showStructure`String one ${1} String two ${2} String ${three}`
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.