freecode camp first line second line javascript

My Experience with Freecode Camp's First Line, Second Line and JavaScript

When I first started learning to code, I was overwhelmed with the different programming languages and frameworks available. That's when I stumbled upon Freecode Camp, a free online coding bootcamp that teaches you everything you need to know to become a full-stack developer. One of the first things I learned in Freecode Camp was the concept of first line, second line, and JavaScript.

What is First Line and Second Line?

In HTML, the first line is usually the DOCTYPE declaration which tells the browser what type of document it is reading. The second line is usually the HTML tag which wraps around the entire HTML document. It is important to include both the DOCTYPE declaration and HTML tag at the beginning of your HTML document for it to be valid.


    <!DOCTYPE html>
    <html lang="en">
        <head>
            <title>My Webpage</title>
        </head>
        <body>
            <h1>Hello World!</h1>
        </body>
    </html>

What is JavaScript?

JavaScript is a programming language that is used to create dynamic and interactive websites. It can be used to add functionality to your HTML and CSS code, such as creating pop-up windows, validating form data, and creating animations.

One of the basic concepts of JavaScript is variables, which are used to store data. You can declare a variable using the var keyword, followed by the variable name and an optional initial value. For example:


    var myName = "Raju";

You can also use JavaScript to manipulate the HTML and CSS of your webpage. For example, you can use the document.getElementById() method to select an HTML element by its ID and change its contents:


    document.getElementById("myHeading").innerHTML = "Hello World!";

Overall, learning about the first line, second line, and JavaScript was a great foundation for my journey to becoming a full-stack developer. Freecode Camp's hands-on approach to learning allowed me to apply these concepts in real-world scenarios and helped me build my coding skills.

Subscribe to The Poor Coder | Algorithm Solutions

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]
Subscribe