We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0e19b1a commit 8c4f339Copy full SHA for 8c4f339
1 file changed
JavaScript/1-superposition.js
@@ -2,12 +2,12 @@
2
3
const pow = Math.pow;
4
const sqrt = Math.sqrt;
5
-const inc = x => x + 1;
+const inc = x => ++x;
6
const add = (a, b) => a + b;
7
const mul = (a, b) => a * b;
8
const div = (a, b) => a / b;
9
const log = (base, n) => Math.log(n) / Math.log(base);
10
-const iff = (e, x1, x2) => e ? x1 : x2;
+const iff = (e, x1, x2) => (e ? x1 : x2);
11
const loop = (from, to, fn) => {
12
for (let i = from; i <= to; i++) fn(i);
13
};
0 commit comments