Posts by Luiz Henrique Soares • 1 point
1 post
-
-1
votes2
answers130
viewsA: Node.js I cannot access a class property in class method
You need to create the variable first and then access it with this. class TODOLIST { public todo: [] = []; constructor() { this.todo = ['task 1']; } public addTodo(): void { this.todo.push(['task…