Get Mac Address

I would like to get the Mac address of the android device. I found this .js file here:

But it outputs the Mac in a window alert:

function(macAddress) {alert(macAddress);},function(fail) {alert(fail);}

I’m a very beginner in Ionic and Javascript. Can someone help me out on how to syntax those lines, in one simple line like macaddressVariable = MacAddress;