create a global variable inside a function node js code example
Example 1: node.js save global variable
global.number = 5;
Example 2: create global variable inside function JavaScript
<script>
function foo() {
window.yourGlobalVariable = ...;
}
</script>