I am looking at the angular authentication application at https://codepen.io/aronrodrigues/pen/YXvBWW. But I don't understand what is happening with the statement
auth.logout && auth.logout();
auth.logout doesn't actually call the function. It will return the function itself, making sure that the function only gets called (the second
auth.logout()) if it actually exists.