Skip to content

Commit 2e9740e

Browse files
committed
Format code style
1 parent 374df97 commit 2e9740e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Maths/CartesianProduct.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
const cartesianProduct = (setA, setB) => {
99
// Check if input sets are not empty.
1010
if (!setA || !setB || !setA.length || !setB.length) {
11-
return null;
11+
return null
1212
}
13-
const product = [];
13+
const product = []
1414

1515
for (let indexA = 0; indexA < setA.length; indexA += 1) {
1616
for (let indexB = 0; indexB < setB.length; indexB += 1) {
17-
product.push([setA[indexA], setB[indexB]]);
17+
product.push([setA[indexA], setB[indexB]])
1818
}
1919
}
2020

2121
return product
2222
}
2323

24-
export { cartesianProduct }
24+
export { cartesianProduct }

Maths/test/CartesianProduct.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {cartesianProduct} from '../CartesianProduct';
1+
import { cartesianProduct } from '../CartesianProduct'
22

33
describe('cartesianProduct', () => {
44
it('should return null if not enough info for calculation', () => {
@@ -11,11 +11,11 @@ describe('cartesianProduct', () => {
1111

1212
it('should calculate the product of two sets', () => {
1313
const product1 = cartesianProduct([1], [1])
14-
const product2 = cartesianProduct([1,2], [3])
14+
const product2 = cartesianProduct([1, 2], [3])
1515
const product3 = cartesianProduct([1, 2], [3, 4])
1616

1717
expect(product1).toEqual([[1, 1]])
18-
expect(product2).toEqual([[1, 3],[2, 3]])
18+
expect(product2).toEqual([[1, 3], [2, 3]])
1919
expect(product3).toEqual([[1, 3], [1, 4], [2, 3], [2, 4]])
2020
})
21-
})
21+
})

0 commit comments

Comments
 (0)