An inner function has always access to the variables and parameters of its outer function, even after the outer function has returned.
An inner function has always access to the variables and parameters of its outer function, even after the outer function has returned
Shortest Simplest way to print current year
<script>document.write(new Date().getFullYear())</script>
Get url without parameters
var mainpage = window.location.origin;
Window.location / Location
console.log(mainpage);
https://azurered.azurewebsites.net
window.location.href = mainpage;
Redirect to https://azurered.azurewebsites.net
Quick redirect to main page without parameters
window.location = '/';