Skip to content

Commit

Permalink
Fix: use let to prevent reassignment error for sandbox result (#1067)
Browse files Browse the repository at this point in the history
In the sandbox/sandbox example, a variable `result` is created as a const, but it's attempted to be reassigned later in the code.  This changeset just changes the `result` variable to be a reassignable variable instead.
  • Loading branch information
stephenkao authored Jan 10, 2024
1 parent 578c684 commit 77897c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api-samples/sandbox/sandbox/sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ <h1>Welcome back</h1>
// Set up message event handler:
window.addEventListener('message', function (event) {
const command = event.data.command;
const template = templates[event.data.templateName],
result = 'invalid request';
const template = templates[event.data.templateName];
let result = 'invalid request';

// if we don't know the templateName requested, return an error message
if (template) {
Expand Down

0 comments on commit 77897c5

Please sign in to comment.