I have two very big functions, a
and b
, which are currently in one big JavaScript file. My goal is to have each function in a separate JavaScript file.
The problem is that a
makes calls to b
, and b
makes calls to a
, so that if I put both functions in different files, then one will be missing the definition of the other, and I get an error message and things break.
When they are in the same file, under the same closure, things don't break because of hoisting. How can I have the two functions in different files when each references the other?