15 lines
230 B
JavaScript
15 lines
230 B
JavaScript
'use strict';
|
|
|
|
class Task {
|
|
constructor(title) {
|
|
this.title = title;
|
|
}
|
|
|
|
static withId(id, title) {
|
|
let task = new Task(title);
|
|
task._id = id;
|
|
return task;
|
|
}
|
|
}
|
|
|
|
module.exports = Task; |