Skip to content

Commit

Permalink
Update exercises
Browse files Browse the repository at this point in the history
  • Loading branch information
tshemsedinov committed Sep 19, 2024
1 parent 0d542fd commit f17652f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Exercises/1-hoisting.test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
({
name: 'fn',
length: [20, 150]
length: [20, 150],
})
4 changes: 2 additions & 2 deletions Exercises/2-by-value.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
[-1, 0],
[10000, 10001],
],
test: inc => {
test: (inc) => {
const a = 5;
const b = inc(a);
if (a === b) throw new Error('Result should not be equal to argument');
if (typeof b !== 'number') throw new Error('Result should be Number');
}
},
})
2 changes: 1 addition & 1 deletion Exercises/3-by-reference.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict';

const inc = null;
const inc = (obj) => null;

module.exports = { inc };
4 changes: 2 additions & 2 deletions Exercises/3-by-reference.test
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[{ n: -1 }, undefined],
[{ n: 10000 }, undefined],
],
test: inc => {
test: (inc) => {
const arg = { n: 5 };
const result = inc(arg);
if (typeof result !== 'undefined') {
Expand All @@ -17,5 +17,5 @@
const res = JSON.stringify(arg);
throw new Error(`Case failed: expected {"n":6}, result: ${res}`);
}
}
},
})
2 changes: 1 addition & 1 deletion Exercises/4-count-types.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
[[true, true, false], { 'boolean': 3 }],
[[1, true, 'hello'], { 'number': 1, 'boolean': 1, string: 1 }],
[[1, 2, true, false, 'a', 'b'], { 'number': 2, 'boolean': 2, string: 2 }],
]
],
})
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

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

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

0 comments on commit f17652f

Please sign in to comment.