location.search returns the query portion of a URL including the Question mark (?). This return a string and then we do substring operation on that string. substring(1) means return the string skipping the first character.
What is history location search?
Location History is a Google Account–level setting that saves where you go with every mobile device where: You’re signed in to your Google Account, You have turned on Location History, and. The device has Location Reporting turned on.
What is location query?
The search property of the Location interface is a search string, also called a query string; that is, a USVString containing a ‘?’ followed by the parameters of the URL. Modern browsers provide URLSearchParams and URL. searchParams to make it easy to parse out the parameters from the querystring.