2

Why am I getting a NPE? After a while I discover why... I had the file of the wrong project open.

LOL

Comments
  • 1
    Why are you using archaic languages that haven’t fixed NPEs? 😅
  • 2
    @Lensflare TypeScript? : D

    The issue was the following:

    this.element.querySelector('h2')!.textContent = this.project.title;

    The project guide set this code up this way (with the exclamation mark, signaling that the element is guaranteed to be found because we were told to place them there).

    My mistake was in leaving index.html of project1 v1 tab open while I was supposed to be working on project1 v2's index.html, resulting in the query for h2 on v2 index.html to not find the element and therefore yielding 'property textContent of null undefined'.
  • 0
    @jestdotty With my didactic skills I will try to teach you its sense:

    Think of it like yelling: "Hey! I'm sure this will work!" lmao

    Nice to see a true JavaScript lover. lol

    Mmmmmmmmmmega Software (ware, ware, ware)

    Double Software

    It made me crazy when I saw ?? and !! and the concept of 'truthy' and 'falsy'. lmao

    Why was it added?

    Readings:

    https://arahansen.com/what-is-the-e...

    Nice to see a fellow passionate frontend dev. :O
Add Comment