From 9f94b1c39ef1464988b7e2ee060689db91373b1c Mon Sep 17 00:00:00 2001 From: Eric Theise Date: Wed, 27 Oct 2021 11:25:06 -0700 Subject: [PATCH] Define with let to avoid "assignment to constant" errors Thanks for this example. Defining `label` with `const` rather than `let` results in `Uncaught TypeError: Assignment to constant variable.` --- docs/configuration/tooltip.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/configuration/tooltip.md b/docs/configuration/tooltip.md index 527b15d99bc..51e8f71f61c 100644 --- a/docs/configuration/tooltip.md +++ b/docs/configuration/tooltip.md @@ -157,7 +157,7 @@ const chart = new Chart(ctx, { tooltip: { callbacks: { label: function(context) { - const label = context.dataset.label || ''; + let label = context.dataset.label || ''; if (label) { label += ': ';