Can anyone explain to me how this works / what it does (more specifically the ( before the function) as I don't understand why the function after inArray has a ( around it?
function geoip(g){window.top.location.href=inArray(g.country_code,filter)?targetVisitorsUrl:allVisitorsUrl}
function inArray(r,n){for(var t=n.length,e=0;t>e;e++)if(n[e]==r)return!0;return!1}
(function(g,e,o,i,p){i=g.createElement(e),p=g.getElementsByTagName(e)[0];i.async=0;i.src=o;p.parentNode.insertBefore(i,p)})(document,'script','https://api.ipdata.co/?api-key=test&callback=geoip');
Thank you