@@ -38,7 +38,7 @@ the window after this event will have no visual flash:
3838
3939``` javascript
4040const { BrowserWindow } = require (' electron' )
41- let win = new BrowserWindow ({ show: false })
41+ const win = new BrowserWindow ({ show: false })
4242win .once (' ready-to-show' , () => {
4343 win .show ()
4444})
@@ -60,7 +60,7 @@ immediately, and use a `backgroundColor` close to your app's background:
6060``` javascript
6161const { BrowserWindow } = require (' electron' )
6262
63- let win = new BrowserWindow ({ backgroundColor: ' #2e2c29' })
63+ const win = new BrowserWindow ({ backgroundColor: ' #2e2c29' })
6464win .loadURL (' https://github.com' )
6565```
6666
@@ -74,8 +74,8 @@ By using `parent` option, you can create child windows:
7474``` javascript
7575const { BrowserWindow } = require (' electron' )
7676
77- let top = new BrowserWindow ()
78- let child = new BrowserWindow ({ parent: top })
77+ const top = new BrowserWindow ()
78+ const child = new BrowserWindow ({ parent: top })
7979child .show ()
8080top .show ()
8181```
@@ -90,7 +90,7 @@ window, you have to set both `parent` and `modal` options:
9090``` javascript
9191const { BrowserWindow } = require (' electron' )
9292
93- let child = new BrowserWindow ({ parent: top, modal: true , show: false })
93+ const child = new BrowserWindow ({ parent: top, modal: true , show: false })
9494child .loadURL (' https://github.com' )
9595child .once (' ready-to-show' , () => {
9696 child .show ()
@@ -597,7 +597,7 @@ e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
597597
598598``` javascript
599599const { BrowserWindow } = require (' electron' )
600- let win = new BrowserWindow ()
600+ const win = new BrowserWindow ()
601601win .on (' app-command' , (e , cmd ) => {
602602 // Navigate the window back when the user hits their mouse back button
603603 if (cmd === ' browser-backward' && win .webContents .canGoBack ()) {
@@ -772,7 +772,7 @@ To check if a DevTools extension is installed you can run the following:
772772``` javascript
773773const { BrowserWindow } = require (' electron' )
774774
775- let installed = BrowserWindow .getDevToolsExtensions (). hasOwnProperty ( ' devtron ' )
775+ const installed = ' devtron ' in BrowserWindow .getDevToolsExtensions ()
776776console .log (installed)
777777```
778778
@@ -789,7 +789,7 @@ Objects created with `new BrowserWindow` have the following properties:
789789``` javascript
790790const { BrowserWindow } = require (' electron' )
791791// In this example `win` is our instance
792- let win = new BrowserWindow ({ width: 800 , height: 600 })
792+ const win = new BrowserWindow ({ width: 800 , height: 600 })
793793win .loadURL (' https://github.com' )
794794```
795795
@@ -1314,9 +1314,9 @@ a HTML-rendered toolbar. For example:
13141314
13151315``` javascript
13161316const { BrowserWindow } = require (' electron' )
1317- let win = new BrowserWindow ()
1317+ const win = new BrowserWindow ()
13181318
1319- let toolbarRect = document .getElementById (' toolbar' ).getBoundingClientRect ()
1319+ const toolbarRect = document .getElementById (' toolbar' ).getBoundingClientRect ()
13201320win .setSheetOffset (toolbarRect .height )
13211321```
13221322
@@ -1440,7 +1440,7 @@ Node's [`url.format`](https://nodejs.org/api/url.html#url_url_format_urlobject)
14401440method:
14411441
14421442``` javascript
1443- let url = require (' url' ).format ({
1443+ const url = require (' url' ).format ({
14441444 protocol: ' file' ,
14451445 slashes: true ,
14461446 pathname: require (' path' ).join (__dirname , ' index.html' )
0 commit comments