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.js
and export the functioninit
from it. - Function
init
should have a single parameterterm
. - Import the function
init
intogameEngine.js
and call it from the functionstartMiningGame
. - Add the parameter
term
to the functionstartMiningGame
. - Import the constant
term
intosolution.js
fromconstants.js
, pass it intostartMiningGame
and then intoinit
. - Inside of the
init
function, 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.