Skip to content

Commit 93fe1e4

Browse files
committed
Moved divide function under last comment.
1 parent 01c04ce commit 93fe1e4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

exceptions/exercises/divide.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Write a function called 'divide' that takes two parameters: a numerator and a denominator.
2-
function divide(numerator, denominator) {
3-
if (denominator === 0) {
4-
throw Error('Attempted to divide by zero.');
5-
}
6-
return numerator / denominator;
7-
}
82

93
// Your function should return the result of numerator / denominator.
104

115
// However, if the denominator is zero you should throw the error, "Attempted to divide by zero."
126

137
// Code your divide function here:
8+
function divide(numerator, denominator) {
9+
if (denominator === 0) {
10+
throw Error('Attempted to divide by zero.');
11+
}
12+
return numerator / denominator;
13+
}

0 commit comments

Comments
 (0)