10 lines
319 B
JavaScript
10 lines
319 B
JavaScript
export const addTwoNumbers = (a, b) => a + b;
|
|
export const subtractTwoNumbers = (a, b) => a - b;
|
|
export const multiplyTwoNumbers = (a, b) => a * b;
|
|
export const divideTwoNumbers = (a, b) => {
|
|
if (b === 0) {
|
|
throw new Error("Cannot divide by zero");
|
|
}
|
|
return a / b;
|
|
}
|
|
export const squareNumber = (a) => a * a;
|