Browse Source

doc: var -> const / let in the console.md

PR-URL: https://github.com/nodejs/node/pull/10451
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
v6
Vse Mozhet Byt 8 years ago
committed by James M Snell
parent
commit
2b4dfeba1d
  1. 6
      doc/api/console.md

6
doc/api/console.md

@ -88,7 +88,7 @@ const errorOutput = fs.createWriteStream('./stderr.log');
// custom simple logger // custom simple logger
const logger = new Console(output, errorOutput); const logger = new Console(output, errorOutput);
// use it like console // use it like console
var count = 5; const count = 5;
logger.log('count: %d', count); logger.log('count: %d', count);
// in stdout.log: count 5 // in stdout.log: count 5
``` ```
@ -217,7 +217,7 @@ values similar to printf(3) (the arguments are all passed to
[`util.format()`][]). [`util.format()`][]).
```js ```js
var count = 5; const count = 5;
console.log('count: %d', count); console.log('count: %d', count);
// Prints: count: 5, to stdout // Prints: count: 5, to stdout
console.log('count:', count); console.log('count:', count);
@ -248,7 +248,7 @@ prints the result to `stdout`:
```js ```js
console.time('100-elements'); console.time('100-elements');
for (var i = 0; i < 100; i++) { for (let i = 0; i < 100; i++) {
; ;
} }
console.timeEnd('100-elements'); console.timeEnd('100-elements');

Loading…
Cancel
Save