#Access class function from within function
3 messages · Page 1 of 1 (latest)
In JS, the this keyword is not the same than in c++/java. It can get messed fast.
I would suggest writing this
const {showNode} = this;
this.children.foreach((child)=>{
shownode();
})
if not, you may want to play with .bind() but that's not my cup of tea