From 77897c576dbcbd2a3bdcfa29d8ebd1e4766f6c79 Mon Sep 17 00:00:00 2001 From: Stephen Kao Date: Wed, 10 Jan 2024 08:30:22 -0500 Subject: [PATCH] Fix: use let to prevent reassignment error for sandbox result (#1067) 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. --- api-samples/sandbox/sandbox/sandbox.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api-samples/sandbox/sandbox/sandbox.html b/api-samples/sandbox/sandbox/sandbox.html index 785c667f..dc6b4312 100644 --- a/api-samples/sandbox/sandbox/sandbox.html +++ b/api-samples/sandbox/sandbox/sandbox.html @@ -57,8 +57,8 @@ limitations under the License. // 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) {