Hey @Vidsify, welcome to forum! I suppose you code will run in browser, and browsers do not have process property. Therefore, as @pschorey pointed out:
function isMac() {
return navigator && navigator.userAgent && /Macintosh/.test(navigator.userAgent);
}