console.log(location.href); // console.log(window.location.href)와 동일
// 결과 예: "https://www.example.com/products/list?page=1#review"
URL 구성 요소
/* 전체 URL 예: https://www.example.com/products/list?page=1#review */

console.log(location.protocol); // console.log(window.location.protocol)과 동일
// "https:"

console.log(location.host); // console.log(window.location.host)와 동일
// "www.example.com"

console.log(location.port); // console.log(window.location.port)와 동일
// "" => 빈 문자열

console.log(location.origin); // console.log(window.location.origin)과 동일
// "https://www.example.com"

console.log(location.pathname); // console.log(window.location.pathname)과 동일
// "/products/list"

console.log(location.search); // console.log(window.location.search)와 동일
// "?page=1"

console.log(location.hash); // console.log(window.location.hash)와 동일
// "#review"