242 B
242 B
title, tags
| title | tags |
|---|---|
| getProtocol | browser,beginner |
Returns the protocol being used on the current page.
- Can be either
http:orhttps:
const getProtocol = () => window.location.protocol;
getProtocol(); // 'https:'