1

I met this line of code and have no idea what '!!' is:

isLoggedIn() {
    return !!this.getJwtToken();
  }

can anyone please help?

toan
  • 101
  • 1
  • 8

1 Answers1

4

This notation is used to get the Boolean value of a variable. In your case it would return false if this.getJwtToken(); is either undefined, null, false or simply an "" empty string.

Freeman Lambda
  • 3,567
  • 1
  • 25
  • 33