Its important to understand what nodeJS is, what its used for. I would recommend you to do some research. Let me know if there are further questions you need help with
did you read my answer? I covered this, the codecademy courses uses the browsers JS engine, while nodeJS uses a different engine, and there are not the same thing…
yes indeed … I did javascript course on codecademy many times but nothing is entering my head.Programming is so volatile.
I know my doubts are stupid but Im just a beginner.I read it on stackoverflow that for debugging javascript file we should use node command prompt.The stackoverflow users said the same thing you are saying that codecadmey uses a different engine.Also they said that we should install the node packages(which i installed given above).Guess I will have to leave the solution ,sometimes in programming we don’t find a solution.
Why not simplify matters for yourself? You have a browser installed on your computer (that seems a safe assumption ), you could use that to run your JS files? Then you don’t have this problems you are facing with nodeJS
don’t know if you learned html? Anyway, if you make two files (in the same directory/folder), one index.html:
and the other a.js with your javscript code. If the JS file has a different name, make sure to change this line:
<script src="a.js"></script>
from a.js to whatever you named your JS file
you can open the html file with your browser, then use the console (f12, then console tab) to run your JS code. Just refresh the page (f5 or ctrl + r) to rerun your JS code
or, if that is too much at the moment, you could use a site like jsbin:
yes this worked .But here’s one more thing I found out that console.log doesn’t run in VS code and Node command prompt.Yes if its a typescript file it runs but not a vanilla javascript code .Because as you mentioned which is correct that