| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d40873d commit 9892a5d
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -423,7 +423,7 @@ const addon = require('./build/Release/addon'); | |||
| 423 | 423 | ||
| 424 | 424 | var obj1 = addon('hello'); | |
| 425 | 425 | var obj2 = addon('world'); | |
| 426 | - console.log(obj1.msg + ' ' + obj2.msg); // 'hello world' | ||
| 426 | + console.log(obj1.msg, obj2.msg); // 'hello world' | ||
| 427 | 427 | ``` | |
| 428 | 428 | ||
| 429 | 429 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -814,7 +814,7 @@ const spawn = require('child_process').spawn; | |||
| 814 | 814 | ||
| 815 | 815 | let child = spawn('sh', ['-c', | |
| 816 | 816 | `node -e "setInterval(() => { | |
| 817 | - console.log(process.pid + 'is alive') | ||
| 817 | + console.log(process.pid, 'is alive') | ||
| 818 | 818 | }, 500);"` | |
| 819 | 819 | ], { | |
| 820 | 820 | stdio: ['inherit', 'inherit', 'inherit'] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -220,7 +220,7 @@ values similar to `printf(3)` (the arguments are all passed to | |||
| 220 | 220 | var count = 5; | |
| 221 | 221 | console.log('count: %d', count); | |
| 222 | 222 | // Prints: count: 5, to stdout | |
| 223 | - console.log('count: ', count); | ||
| 223 | + console.log('count:', count); | ||
| 224 | 224 | // Prints: count: 5, to stdout | |
| 225 | 225 | ``` | |
| 226 | 226 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -107,8 +107,8 @@ Example: | |||
| 107 | 107 | const https = require('https'); | |
| 108 | 108 | ||
| 109 | 109 | https.get('https://encrypted.google.com/', (res) => { | |
| 110 | - console.log('statusCode: ', res.statusCode); | ||
| 111 | - console.log('headers: ', res.headers); | ||
| 110 | + console.log('statusCode:', res.statusCode); | ||
| 111 | + console.log('headers:', res.headers); | ||
| 112 | 112 | ||
| 113 | 113 | res.on('data', (d) => { | |
| 114 | 114 | process.stdout.write(d); | |
@@ -151,8 +151,8 @@ var options = { | |||
| 151 | 151 | }; | |
| 152 | 152 | ||
| 153 | 153 | var req = https.request(options, (res) => { | |
| 154 | - console.log('statusCode: ', res.statusCode); | ||
| 155 | - console.log('headers: ', res.headers); | ||
| 154 | + console.log('statusCode:', res.statusCode); | ||
| 155 | + console.log('headers:', res.headers); | ||
| 156 | 156 | ||
| 157 | 157 | res.on('data', (d) => { | |
| 158 | 158 | process.stdout.write(d); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,7 +12,7 @@ The contents of `foo.js`: | |||
| 12 | 12 | ||
| 13 | 13 | ```js | |
| 14 | 14 | const circle = require('./circle.js'); | |
| 15 | - console.log( `The area of a circle of radius 4 is ${circle.area(4)}`); | ||
| 15 | + console.log(`The area of a circle of radius 4 is ${circle.area(4)}`); | ||
| 16 | 16 | ``` | |
| 17 | 17 | ||
| 18 | 18 | The contents of `circle.js`: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -171,8 +171,8 @@ Here is an example that logs every unhandled rejection to the console | |||
| 171 | 171 | ||
| 172 | 172 | ```js | |
| 173 | 173 | process.on('unhandledRejection', (reason, p) => { | |
| 174 | - console.log("Unhandled Rejection at: Promise ", p, " reason: ", reason); | ||
| 175 | - // application specific logging, throwing an error, or other logic here | ||
| 174 | + console.log('Unhandled Rejection at: Promise', p, 'reason:', reason); | ||
| 175 | + // application specific logging, throwing an error, or other logic here | ||
| 176 | 176 | }); | |
| 177 | 177 | ``` | |
| 178 | 178 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -296,12 +296,12 @@ const vm = require('vm'); | |||
| 296 | 296 | var localVar = 'initial value'; | |
| 297 | 297 | ||
| 298 | 298 | const vmResult = vm.runInThisContext('localVar = "vm";'); | |
| 299 | - console.log('vmResult: ', vmResult); | ||
| 300 | - console.log('localVar: ', localVar); | ||
| 299 | + console.log('vmResult:', vmResult); | ||
| 300 | + console.log('localVar:', localVar); | ||
| 301 | 301 | ||
| 302 | 302 | const evalResult = eval('localVar = "eval";'); | |
| 303 | - console.log('evalResult: ', evalResult); | ||
| 304 | - console.log('localVar: ', localVar); | ||
| 303 | + console.log('evalResult:', evalResult); | ||
| 304 | + console.log('localVar:', localVar); | ||
| 305 | 305 | ||
| 306 | 306 | // vmResult: 'vm', localVar: 'initial value' | |
| 307 | 307 | // evalResult: 'eval', localVar: 'eval' | |
| Back | FazBrowse Home | New Git URL |
0 commit comments