Skip to content

Commit f17652f

Browse files
committed
Update exercises
1 parent 0d542fd commit f17652f

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Exercises/1-hoisting.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
({
22
name: 'fn',
3-
length: [20, 150]
3+
length: [20, 150],
44
})

Exercises/2-by-value.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
[-1, 0],
88
[10000, 10001],
99
],
10-
test: inc => {
10+
test: (inc) => {
1111
const a = 5;
1212
const b = inc(a);
1313
if (a === b) throw new Error('Result should not be equal to argument');
1414
if (typeof b !== 'number') throw new Error('Result should be Number');
15-
}
15+
},
1616
})

Exercises/3-by-reference.js

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

3-
const inc = null;
3+
const inc = (obj) => null;
44

55
module.exports = { inc };

Exercises/3-by-reference.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[{ n: -1 }, undefined],
88
[{ n: 10000 }, undefined],
99
],
10-
test: inc => {
10+
test: (inc) => {
1111
const arg = { n: 5 };
1212
const result = inc(arg);
1313
if (typeof result !== 'undefined') {
@@ -17,5 +17,5 @@
1717
const res = JSON.stringify(arg);
1818
throw new Error(`Case failed: expected {"n":6}, result: ${res}`);
1919
}
20-
}
20+
},
2121
})

Exercises/4-count-types.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
[[true, true, false], { 'boolean': 3 }],
66
[[1, true, 'hello'], { 'number': 1, 'boolean': 1, string: 1 }],
77
[[1, 2, true, false, 'a', 'b'], { 'number': 2, 'boolean': 2, string: 2 }],
8-
]
8+
],
99
})

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017-2023 How.Programming.Works contributors
3+
Copyright (c) 2017-2024 How.Programming.Works contributors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)