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