How to check if I run JavaScript code in a browser or not in a browser? -


How to check if I run this code in a browser or not in the browser? I have something like this

  var x = 5; If (/ * inside a browser * /) document.write (x); Else / * without browser * / console.log (x); = 'Undefined') (/ => unchangeable)    

  / I I am inside the environment; And {// am elsewhere (server?)}    

Comments

Popular posts from this blog

Android - Facebook GraphUser has no email attribute -

deployment - How to upload Parent child SSIS package to server -

Opencart and VQMOD issue: Could not load controller in vq2-system_engine_controller.php -