-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.js
More file actions
45 lines (34 loc) · 1.01 KB
/
Copy pathmain.js
File metadata and controls
45 lines (34 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// This is the main JavaScript file of your sample project.
// Import the utility functions from util.js
const { add, subtract } = require('./util');
// Function to add two numbers
function addNumbers(a, b) {
console.log('Adding numbers:', a, b);
return add(a, b);
}
// Function to multiply two numbers
function multiplyNumbers(a, b) {
console.log('Multiplying numbers:', a, b);
return a * b;
}
// Function to subtract two numbers
function subtractNumbers(a, b) {
return subtract(a, b);
}
// Removed the unused variable
// const unusedVariable = 'This variable is not used';
// Removed the missing semicolon
const missingSemicolon = 'This line is missing a semicolon';
// Removed the undefined variable usage
// console.log(undefinedVariable);
// Removed the attempt to reassign a constant
// const constantValue = 42;
// constantValue = 43;
// Removed the missing function argument
// function missingArgument(arg1, arg2) {
// return arg1 + arg2;
// }
module.exports = {
addNumbers,
subtractNumbers,
};