<分区>
我发现了一些关于使用 angular 进行身份验证的代码,但我无法理解这个技巧:
authService.isAuthenticated = function () {
return !!Session.userId;
};
!!
是什么意思“不同的 userId”?
每当 true = !!true = !!!!true =>etc
时,它不理解这一点。
有人可以帮助我吗?
(https://medium.com/opinionated-angularjs/techniques-for-authentication-in-angularjs-applications-7bbf0346acec 为来源,部分“The AuthService”)