You can use any of the above syntax to retrieve the location protocol name.
Following syntax shows how to reset the location protocol property value:
location.protocol = "value";
e.g.: location.protocol = "https:";