🟨Advanced JavaScript autograding
Discover the advanced grading options available for JavaScript assignments
🟨Create your first JavaScript assignment





Jest
// Function to add two numbers
function add(a, b) {
return a + b;
}
// Function to subtract the second number from the first
function subtract(a, b) {
return a - b;
}
// Function to multiply two numbers
function multiply(a, b) {
return a * b;
}
// Function to divide the first number by the second
// Throws an exception if the second number is 0
function divide(a, b) {
if (b === 0) {
throw new Error("Division by zero is not allowed.");
}
return a / b;
}
// Export the functions for use in other modules
module.exports = {
add,
subtract,
multiply,
divide
};"cg junitxml" command

Instructions

ESLint
"cg comments" command


Requirements
Instructions

Conclusion
Last updated