So, you’ve already exported the constant term that will allow us to control the terminal.
Let’s make some use of it!
- Create the file
functions.jsand export the functioninitfrom it. - Function
initshould have a single parameterterm. - Import the function
initintogameEngine.jsand call it from the functionstartMiningGame. - Add the parameter
termto the functionstartMiningGame. - Import the constant
termintosolution.jsfromconstants.js, pass it intostartMiningGameand then intoinit. - Inside of the
initfunction, add the lineterm('Welcome to the mining game!').
As a result, you should see the message Welcome to the mining game! printed on the screen
P.S. term should ONLY be imported into solution.js.
This task is part of the Full-Stack JavaScript Course.
If you have any issues with it, you can ask for community help below the post.
Feel free to help others if you’ve already solved the task.