Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cebd8f3

Browse files
committed
Update examples
1 parent 3dead74 commit cebd8f3

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.eslintrc.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
"parserOptions": {
99
"ecmaVersion": 2020
1010
},
11-
"globals": {
12-
"BigInt": true
13-
},
1411
"rules": {
1512
"indent": [
1613
"error",
@@ -213,7 +210,7 @@
213210
],
214211
"arrow-parens": [
215212
"error",
216-
"as-needed"
213+
"always"
217214
],
218215
"arrow-body-style": [
219216
"error",

JavaScript/2-const-let.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
console.dir({ hoisted }); // { hoisted: undefined }
44
hoisted = 5; // Assign 5 to hoisted
55
console.dir({ hoisted }); // { hoisted: 5 }
6-
var hoisted; // Declare hoisted
6+
let hoisted; // Declare hoisted
77

88
let scalarVariable = 6;
99
const scalarConstant = 7;

JavaScript/6-parse.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
console.log(parseInt('11', 2)); // 3
4-
console.log(parseInt('11', 8)); // 9
5-
console.log(parseInt('11', 16)); // 17
3+
console.log(0b11); // 3
4+
console.log(0o11); // 9
5+
console.log(0x11); // 17
66

77
console.log(parseInt(5, 10)); // 5
88
console.log(parseInt('5', 10)); // 5
@@ -25,7 +25,7 @@ console.log(0.0000005, parseInt(0.0000005, 10)); // 5e-7 5
2525
console.log(0.000005, parseInt(0.000005, 10)); // 0.000005 0
2626

2727
// 255
28-
console.log(parseInt('fF', 16));
28+
console.log(0xfF);
2929
console.log(parseInt('0xff', 16));
3030
console.log(parseInt('0xFf', 16));
3131
console.log(parseInt(' 0xFf ', 16));
@@ -36,7 +36,7 @@ console.log(parseInt('ff', 8));
3636
console.log(parseInt('ff', 10));
3737
console.log(parseInt('ff', 15));
3838

39-
console.log(parseInt('ff', 16)); // 255
39+
console.log(0xff); // 255
4040
console.log(parseInt('ff', 17)); // 270
4141
console.log(parseInt('ff', 20)); // 315
4242
console.log(parseInt('ff', 30)); // 465

0 commit comments

Comments
 (0)