I would like to know if there is a method to importing scripts from javascript script to another javascript script.
For example,
import script.js //obviously it is wrong.
Lets say on script 1:
function hello(){
console.log(1+2);
}
I would like to use the functions defined in script 1 on script 2.
Therefore, script 2 should have:
hello();
And should produce this on the webpage:
3
I went to research for answers, yet i do not understand the codes. Can someone explain it, step by step?