A programming language that compiles into JavaScript, offering more concise and readable syntax while maintaining full JavaScript compatibility.
77
Build a task management system that organizes and filters tasks efficiently.
Implement a TaskManager class that:
Stores a collection of tasks, where each task has:
Provides methods to:
The class should:
BaseManager class that provides a log method for tracking operations@generates
class BaseManager
log: (message) ->
console.log "[#{new Date().toISOString()}] #{message}"
class TaskManager extends BaseManager
constructor: () ->
addTask: (title, priority, status, dueDate) =>
getTasksByStatus: (status) =>
getHighPriorityTasks: () =>
getTasksDueSoon: (days) =>
completeTask: (title) =>
module.exports = { TaskManager, BaseManager }Creating a TaskManager and adding a task with title "Write tests", priority 3, status "pending", due date 2 days from now stores the task correctly @test
Calling getTasksByStatus("pending") returns only tasks with "pending" status @test
Calling getHighPriorityTasks() returns only tasks where priority equals 3 @test
Calling getTasksDueSoon(7) returns tasks with due dates within the next 7 days from today @test
Calling completeTask("Write tests") changes that task's status to "completed" @test
Methods remain bound when extracted from the instance and called separately @test
The log method from BaseManager is accessible via super and logs operations @test
Provides the CoffeeScript compiler for writing code with advanced language features including bound methods, super calls, and comprehensions.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-coffeescriptevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10