Skip to content

Instantly share code, notes, and snippets.

@oguzhancvdr
Last active October 22, 2022 19:49
Show Gist options
  • Save oguzhancvdr/3578812ec8422a9d4fff3204af5d3844 to your computer and use it in GitHub Desktop.
Save oguzhancvdr/3578812ec8422a9d4fff3204af5d3844 to your computer and use it in GitHub Desktop.
const judgeDeviceType =
() => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|OperaMini/i.test(navigator.userAgent) ? 'Mobile' : 'PC';
judgeDeviceType()
// PC | Mobile
@oguzhancvdr
Copy link
Author

Check device type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment