Watch a demo of different values of the measureText() method.
Or click a specific value to see the result:
const c = document.getElementById('myCanvas'); const ctx = c.getContext('2d'); ctx.font='30px Arial'; const m=ctx.measureText('How are you?'); ctx.fillText(m.width,10,30);