diff options
author | Diego RodrÃguez Baquero <github@diegorbaquero.com> | 2021-07-03 01:33:07 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-03 01:33:07 +0300 |
commit | 0e2c88e9ebcccc9d831fc06deda16cea24247281 (patch) | |
tree | 550a3b9cfadee5c6500a14eaf2eb6106cb19e005 /docs/faq.md | |
parent | 5917ac93da67fe02929af2bacc4c192660716aa1 (diff) |
docs: no more var (#2123)
* docs: no more var
* Update api.md
* remove var
* remove var
Diffstat (limited to 'docs/faq.md')
-rw-r--r-- | docs/faq.md | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/faq.md b/docs/faq.md index 20f8641..ee2fdd4 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -233,13 +233,13 @@ script on your page. If you use [browserify](http://browserify.org/), you can It's easy to download a torrent and add it to the page. ```js -var client = new WebTorrent() +const client = new WebTorrent() -var torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent' +const torrentId = 'magnet:?xt=urn:btih:08ada5a7a6183aae1e09d831df6748d566095a10&dn=Sintel&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel.torrent' client.add(torrentId, function (torrent) { // Torrents can contain many files. Let's use the .mp4 file - var file = torrent.files.find(function (file) { + const file = torrent.files.find(function (file) { return file.name.endsWith('.mp4') }) file.appendTo('body') // append the file to the DOM |