Skip to content

Instantly share code, notes, and snippets.

@GitHubEmploy
Created January 14, 2022 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GitHubEmploy/45b6a55aaa7fce61903b54eb7a8aafc7 to your computer and use it in GitHub Desktop.
Save GitHubEmploy/45b6a55aaa7fce61903b54eb7a8aafc7 to your computer and use it in GitHub Desktop.
const touchSupported = () => {
(‘ontouchstart’ in window || window.DocumentTouch && document instanceof window.DocumentTouch);
}
console.log(touchSupported()); // Result: If touch event is supported, it will return True, otherwise it will return False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment