So I'm trying to name an object according to the website that I'm currently visiting using a class. I understand that location.hostname will tell me what website I'm currently visiting. I give you an example:
Site = function() {};
location.hostname = new Site();
Obviously that doesn't work. So, what would I have to do to make a new object of the Site class that had the name of the value of location.hostname? Thanks.