I want to include a javascript file into a main file. Unlike C/C++, where #include means "include all variables and functions", export/import and module.exports are only suitable for moduled files. How can I implement the one of C/C++ in javascript without using eval()? Here's an example.
header.js
var a = 1;
function b(){};
main.js
// How can I include header.js?
console.log(a);
console.log(b());