Created
October 3, 2021 09:32
-
-
Save sayyedhammadali/a8c82b2501c5c82b869312f08d90340b to your computer and use it in GitHub Desktop.
Check if the current user has touch events supported
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const touchSupported = () => { | |
('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch); | |
} | |
console.log(touchSupported()); | |
// Result: will return true if touch events are supported, false if not |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
should be: