Skip to content

Commit

Permalink
Define with let to avoid "assignment to constant" errors
Browse files Browse the repository at this point in the history
Thanks for this example. Defining `label` with `const` rather than `let` results in `Uncaught TypeError: Assignment to constant variable.`
  • Loading branch information
erictheise committed Oct 27, 2021
1 parent 10106e4 commit 9f94b1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/configuration/tooltip.md
Expand Up @@ -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 += ': ';
Expand Down

0 comments on commit 9f94b1c

Please sign in to comment.