Skip to content

Commit

Permalink
README: Fix wrong example for setTimeout
Browse files Browse the repository at this point in the history
Picks up openhab/openhab-addons#16103.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Dec 25, 2023
1 parent ed1062d commit 6fb5c99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ var myVar = 'Hello world!';
// Schedule a timer that expires in ten seconds
setTimeout(() => {
console.info(`Timer expired with variable value = "${myVar}"`);
}, 1000);
}, 10000);

myVar = 'Hello mutation!'; // When the timer runs, it will log "Hello mutation!" instead of "Hello world!"
```
Expand All @@ -304,7 +304,7 @@ var myVar = 'Hello world!';
// Schedule a timer that expires in ten seconds
setTimeout((myVariable) => {
console.info(`Timer expired with variable value = "${myVariable}"`);
}, 1000, myVar); // Pass one or more variables as parameters here. They are passed through to the callback function.
}, 10000, myVar); // Pass one or more variables as parameters here. They are passed through to the callback function.

myVar = 'Hello mutation!'; // When the timer runs, it will log "Hello world!"
```
Expand Down

0 comments on commit 6fb5c99

Please sign in to comment.