Skip to content

Commit 97d6125

Browse files
authored
Merge pull request #482 from sjrd/use-const-in-es2015-example
Use `const` instead of `var` in ES 2015 examples.
2 parents 3df344e + f6d11e8 commit 97d6125

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/sjs-for-js/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Below you can see the same functionality implemented in JavaScript ES6 and Scala
88
{% columns %}
99
{% column 6 ES6 %}
1010
{% highlight javascript %}
11-
var xhr = new XMLHttpRequest();
11+
const xhr = new XMLHttpRequest();
1212

1313
xhr.open("GET",
1414
"https://api.twitter.com/1.1/search/" +
1515
"tweets.json?q=%23scalajs"
1616
);
1717
xhr.onload = (e) => {
1818
if (xhr.status === 200) {
19-
var r = JSON.parse(xhr.responseText);
19+
const r = JSON.parse(xhr.responseText);
2020
$("#tweets").html(parseTweets(r));
2121
}
2222
};

0 commit comments

Comments
 (0)