+ 1

Unable to solve 65 Code Project Words

Why is this giving an error its the last code project from the JavaScript course https://code.sololearn.com/ctW2h4WiA6dk/?ref=app

26th Oct 2021, 6:20 PM
Lunu'anaki
Lunu'anaki - avatar
2 odpowiedzi
+ 5
That’s because ‘this.k’ doesn’t exist. You may ask “why? I’ve declared it in the constructor” The problem here is that you used var k =[] (variable with local scope inside constructor) but you should use this.k = [] instead (adds k as an object property).
26th Oct 2021, 6:39 PM
Guillem Padilla
Guillem Padilla - avatar
+ 2
Thanks for answering
26th Oct 2021, 6:50 PM
Lunu'anaki
Lunu'anaki - avatar