0

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

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

can anyone please help?

toan
  • 55
  • 5

1 Answers1

2

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,292
  • 1
  • 23
  • 32