8000 added trailing semicolon to all function and module exports · jinc1026/javascript-exercises@2f63b3e · GitHub
[go: up one dir, main page]

Skip to content

Commit 2f63b3e

Browse files
author
Michael Frank
committed
added trailing semicolon to all function and module exports
1 parent 58d2eb1 commit 2f63b3e

File tree

30 files changed

+2096
-7340
lines changed

30 files changed

+2096
-7340
lines changed

.eslintrc.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"extends": "airbnb-base",
3+
"plugins": [
4+
"import"
5+
],
6+
"parserOptions": {
7+
"ecmaVersion": 12,
8+
"sourceType": "module"
9+
},
10+
"rules": {
11+
}
12+
}

caesar/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Exercise XX - caesar cipher
1+
# Exercise XX - Caesar cipher
22

3-
Implement the legendary caesar cipher:
3+
Implement the legendary Caesar cipher:
44

55
> In cryptography, a Caesar cipher, also known as Caesar's cipher, the shift cipher, Caesar's code or Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of positions down the alphabet. For example, with a left shift of 3, D would be replaced by A, E would become B, and so on. The method is named after Julius Caesar, who used it in his private correspondence.
66
@@ -31,5 +31,3 @@ negative numbers should work as well:
3131
```javascript
3232
caesar('Mjqqt, Btwqi!', -5) // returns 'Hello, World!'
3333
```
34-
35-

caesar/caesar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const caesar = function() {
22

3-
}
3+
};;
44

5-
module.exports = caesar
5+
module.exports = caesar;

calculator/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ The goal for this exercise is to create a calculator that does the following:
22

33
add, subtract, get the sum, multiply, get the power, and find the factorial
44

5-
In order to do this please fill out each function with your solution. Make sure to return the value so you can test it in Jasmine! To see the expected value
6-
take a look at the spec file that houses the Jasmine test cases.
5+
In order to do this please fill out each function with your solution. Make sure to return the value so you can test it in Jest! To see the expected value
6+
take a look at the spec file that houses the Jest test cases.

calculator/calculator.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
const add = function() {
22

3-
}
3+
};
44

55
const subtract = function() {
66

7-
}
7+
};
88

99
const sum = function() {
1010

11-
}
11+
};
1212

1313
const multiply = function() {
1414

15-
}
15+
};;
1616

1717
const power = function() {
1818

19-
}
19+
};
2020

2121
const factorial = function() {
2222

23-
}
23+
};
2424

2525
module.exports = {
2626
add,
@@ -29,4 +29,4 @@ module.exports = {
2929
multiply,
3030
power,
3131
factorial
32-
}
32+
};

calculator/calculator.spec.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
1-
const calculator = require ('./calculator.js');
1+
const calculator = require('./calculator');
22

33
describe('add', () => {
44
test('adds 0 and 0', () => {
55
expect(calculator.add(0,0)).toBe(0);
66
});
77

8-
test('adds 2 and 2', () => {
8+
test.skip('adds 2 and 2', () => {
99
expect(calculator.add(2,2)).toBe(4);
1010
});
1111

12-
test('adds positive numbers', () => {
12+
test.skip('adds positive numbers', () => {
1313
expect(calculator.add(2,6)).toBe(8);
1414
});
1515
});
1616

1717
describe('subtract', () => {
18-
test('subtracts numbers', () => {
18+
test.skip('subtracts numbers', () => {
1919
expect(calculator.subtract(10,4)).toBe(6);
2020
});
2121
});
2222

2323
describe('sum', () => {
24-
test('computes the sum of an empty array', () => {
24+
test.skip('computes the sum of an empty array', () => {
2525
expect(calculator.sum([])).toBe(0);
2626
});
2727

28-
test('computes the sum of an array of one number', () => {
28+
test.skip('computes the sum of an array of one number', () => {
2929
expect(calculator.sum([7])).toBe(7);
3030
});
3131

32-
test('computes the sum of an array of two numbers', () => {
32+
test.skip('computes the sum of an array of two numbers', () => {
3333
expect(calculator.sum([7,11])).toBe(18);
3434
});
3535

36-
test('computes the sum of an array of many numbers', () => {
36+
test.skip('computes the sum of an array of many numbers', () => {
3737
expect(calculator.sum([1,3,5,7,9])).toBe(25);
3838
});
3939
});
4040

4141
describe('multiply', () => {
42-
test('multiplies two numbers', () => {
42+
test.skip('multiplies two numbers', () => {
4343
expect(calculator.multiply([2,4])).toBe(8);
4444
});
4545

46-
test('multiplies several numbers', () => {
46+
test.skip('multiplies several numbers', () => {
4747
expect(calculator.multiply([2,4,6,8,10,12,14])).toBe(645120);
4848
});
4949
});
5050

5151
describe('power', () => {
52-
test('raises one number to the power of another number', () => {
52+
test.skip('raises one number to the power of another number', () => {
5353
expect(calculator.power(4,3)).toBe(64); // 4 to third power is 64
5454
});
5555
});

fibonacci/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Exercise XX - fibonacci
1+
# Exercise XX - Fibonacci
22

3-
Create a function that returns a specific member of the fibonacci sequence:
3+
Create a function that returns a specific member of the Fibonacci sequence:
44

5-
> a series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.
5+
> A series of numbers in which each number ( Fibonacci number ) is the sum of the two preceding numbers. The simplest is the series 1, 1, 2, 3, 5, 8, etc.
66
77
```javascript
88
fibonacci(4) // returns the 4th member of the series: 3 (1, 1, 2, 3)

fibonacci/fibonacci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fibonacci = function() {
22

3-
}
3+
};
44

55
module.exports = fibonacci;

findTheOldest/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# Find the Oldest
22

3-
given an array of objects representing people with a birth and death year, return the oldest person.
3+
Given an array of objects representing people with a birth and death year, return the oldest person.
44

55
## Hints
66
- You should return the whole person object, but the tests mostly just check to make sure the name is correct.
77
- this can be done with a couple of chained array methods, or by using `reduce`.
88
- One of the tests checks for people with no death-date.. use JavaScript's Date function to get their age as of today.
9-

findTheOldest/findTheOldest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const findTheOldest = function() {
22

3-
}
3+
};
44

5-
module.exports = findTheOldest
5+
module.exports = findTheOldest;

0 commit comments

Comments
 (0)
0