how to create global variable inside a function javascript code example
Example: create global variable inside function JavaScript
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>