Hello World in JS !

Full stack engineer but passionnated by front-end Angular Expert / NX / JavaScript / Node / Redux State management / Rxjs

Hello World
As usual the first thing to do when you are beginning a new language : Hello World !
Why Hello World ? ๐
In JS they are multiple different ways to do that :
- Using alert box
- Using the console
- Modifying the DOM ...
I coded for you few examples, feel free to do the same thing on your computer, you just need a text editor and a web browser to open your HTML file ๐
Code


Explanations
alert() method will open an alert box when the page is loaded containing the string that you passed in
console.log() method is logging your string as a message in the console
console.warn() method is logging your string as a warning in the console
document.querySelector("#id") is returning the DOM element with ID, and textContent will help to add text to this element
๐ In my next post you can see how to declare variables in JS ๐




![TypeScript's [number] Index Signature: Extract Union Types from Arrays](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1752960594694%2Fe2be9492-869f-4169-bb1a-950ee81a3887.png&w=3840&q=75)