From the course: Learning Functional Programming with JavaScript ES6+

Setting up the project: Hello World - JavaScript Tutorial

From the course: Learning Functional Programming with JavaScript ES6+

Start my 1-month free trial

Setting up the project: Hello World

- [Instructor] Let's create a very simple file. We'll call it hello-world.js, and inside it we'll type some code with very basic ES6 syntax. We'll say const sayHello, and that'll be a function that takes our name, and with backticks says hello name. After we've typed this out, let's just call our function with our own name. Now, to run our code, make sure you're in the right directory and type npx babel-node, and then hello-world.js, and hit Enter, and we should see the result. That's all there is to it. That's how we'll be running all the code in this course. It's also worth noting that if you want to play around with this code without writing it in a file first, you can also just type npx babel-node without a file name, and hit Enter, and it'll open up this read a value print loop in our terminal where we can test out different statements. Keep in mind, also, that from now on when I run code in the course I'm going to be running it from the exercise files folder. The only difference that makes is that the file paths in my commands might be a little different, so when you're running your own code just make sure that the file path points to the correct file.

Contents