Skip to content

Instantly share code, notes, and snippets.

@GoodBoyNinja
Created February 1, 2021 13:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GoodBoyNinja/c2fdf6fc18846eea7ddcc0dd05b26c07 to your computer and use it in GitHub Desktop.
Save GoodBoyNinja/c2fdf6fc18846eea7ddcc0dd05b26c07 to your computer and use it in GitHub Desktop.
This function is described as "isMacOS" in order to easily use the returned result (true / false) to do stuff accordingly. Check out the example code for a proper use of this function.
function isMacOS(){
var currentSystemOS = String($.os).toLowerCase();
if (currentSystemOS.indexOf("mac") == -1) {
return false
} else {
return true;
}
}
isMacOS();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment