-
JavaScript is a lightweight compiled programming language with the first-class functions.
-
JavaScript was created to run in the browser (mostly used for the Web), however it is also used in non-browser environments: Node.js (server side) and Electron (desktop applications).
Let’s write an improved version of the ‘Hello, world!’ program. Let’s ask the user in which language they want to see the message. You must have, at least, three different languages.
- If the user wants the message in Spanish, you have to log in the console “Hola, mundo!”.
- If the user wants the message in French, you have to log in the console “Bonjour tout le monde”.
- Finally, if we don’t have the indicated language, we will show “Hello, world!”.
Let’s write a for
loop that will iterate from 0 to 20. For each iteration,
it will check if the current number is even or odd, and print that on the screen.
You will need the modulo (remainder) operator for this exercise.
Make sure that number 0 is not printed.