Solution: lb_cron

Node.js·1 min read·Mar 23, 2025

Here is the commented solution for this project.

Set up the project

Create a file named lb_cron.js.

touch lb_cron.js

Implement the Task class

The objective of this part is to implement a class that represents an asynchronous task.

Declare a new class named Task.

lb_cron.js
class Task {  constructor(name, schedule, callback) {    //  }}

Check if the constructor's name parameter is valid, and either store its value into the public name field or throw an error.

lb_cron.js
class Task {  constructor(name, schedule, callback) {