React is not a programming language. React interfaces are described using JavaScript or TypeScript. We start with JavaScript and text output. You do not need a website yet. Node.js runs JavaScript outside the browser. A browser also provides functions for web pages. Later we use React in both browsers and mobile apps.
01Prepare Node.js
Install Node.js 22 or newer from its official website. Open a terminal and check node --version. Create a new learning folder. A terminal executes commands while an editor edits files. You need both.
02Write code
Save the example as hello.mjs. .mjs identifies a JavaScript module. console.log writes a value to the console. Parentheses contain supplied values. Quotation marks make the contents text.
console.log('Hello, AppFabrik!');
Run / check
node hello.mjs03Run and change
Run node hello.mjs in the file’s folder. Change the greeting, save and run it again. Unlike in a browser, document is not automatically available in Node.js. document belongs to a web page rather than the language itself.
Hello, AppFabrik!
Your exercise
Print a second line containing your first name. Also open your browser’s developer console and execute the same console.log call.
Show the solution and explanation
Add console.log("Your name"). Both environments understand this call. Output goes to the terminal or browser console respectively. This does not prove that every other API exists in both environments.
Project context and sources
The example is simplified for learning. The linked source version shows its use in the project and the checks applied there.