If the output is New User, try refreshing this page. The output, should say "Return user", cool right? Let's break down what's happening here:
- First of all we check to see if the browser supports local storage
- so then we read the stored data to determine if there's a boolean set called "return_user".
- "return_user" is true, we output "Return User" else we output that the user is visiting for the first time.
That's it! Easy right? A simple way to detect returning users on your site . If you found this helpful be sure to share!