When one imports a specific value from another file, does the entire file that has been exported from run in the file importing? For example if I wanted to import the function "hello" from file b, into file a, would file b run in file a?
An example being:
File A:
import {func} from 'fileB.js';
File B:
let func = function(){...}
console.log(`Hello`);
export {func};
Would Hello
appear in the console of file A, and if it would, under what circumstances. For example, would it be when the import statement is run, or when the func
is called. If it would not run, are there any ways to make it so it does. For example if I exported the entire file (if that's possible) would the Hello
appear under certain circumstances?