how to check whether we are running on electron or browser

JavaScript
npm install --save is-electronlet isElectron = require("is-electron");

if(isElectron()){
    console.log("Electron aww yeahhh !");
}else{
    console.log("Running in other platform as a normal browser");
}
Source

Also in JavaScript: