I am watching the freeCodeCamp youTube videos and want to practice it myself. I have got codePen and have saved a .js file and written out the code from the tutorial. Nothing displays in the console. How do I run a .js file in the console like Beau is in the videos?
Assuming you mean that you just have some JS code written in to the JS section on the Codepen, you are looking to run it and get a display in the console?
Turn off >settings>behavior > auto updating preview (top right)
Turn on Console (bottom left)
Hit Run (top center)
Here’s a quick example:
This should evaluate your JS and output any calls to console log, etc
So basically all I have written is:
myName = “Mike”;
console.log("My name is " + myName);
which would display, My name is Mike
That’s all I want to do, write simple code to practice how different things work and display it in the console so I can see the result.
I have looked at what you suggested, I can’t find auto updating preview (top right). I don’t know whether being on the free online version makes a difference?
Is there any other software that I can use for this? I have got DreamWeaver and Brackets on my Mac, but I am having the same problem using them.
Behaviour > Auto-udpate preview > off
I personally love atom on my Mac from https://atom.io as a full fledge JS test suite
Thank you for all your help, I will have a look at Atom to see how I get on
You can use jsbin as well.
try launching atom from terminal with “atom .” If I remember correctly this is needed to load your path variables
Another thing to check is that you have clicked the ‘console’ button at the bottom to open the console.
Thank you to everyone for there advise and help.