JavaScript is an incredibly powerful and versatile programming language that has revolutionized the way websites and web applications are created. In this article, we'll explore the fundamentals of JavaScript and how it can be used to create dynamic, interactive web pages. We'll also discuss the history of JavaScript, its impact on web development, and some of the basic concepts to help you get started. So, let's dive in and start learning about this exciting language!


A Brief History of JavaScript

In 1993, Mosaic, the first web browser with a GUI (Graphical User Interface), was released and made available to non-technical people. This played a very Instrumental role in the growth of the embryonic World Wide Web and the Internet in general. After its success, the lead developer of Mosaic founded the Netscape Corporation, and a more refined version- The Netscape Navigator, was released in 1994.

Initially, web pages of this time could only be static, so there was a need to remove this limitation and build dynamic handling web pages. Netscape decided to add a scripting language to their browser to solve this problem. Brendan Eich, an American computer programmer, was initially hired by Netscape to embed the Scheme language. Eventually, It was decided that it would be a better option for Eich to devise a new scripting language, similar to Java but less like Scheme.

In September 1995, LiveScript was shipped as part of the Navigator beta. The name was later changed to JavaScript in December 1995 as part of a marketing ploy, as Java was one of the most popular languages then.

What is JavaScript?

JavaScript is a high-level, dynamically typed, prototype-based programming language. Let's break down this definition:

Now that we have an understanding of what JavaScript is, let us explore what it does.

What Can I Do With JavaScript?

JavaScript can be used in two ways:

Now that we understand what JavaScript is, let us briefly explore some concepts and paradigms it entails.

JavaScript Concepts


Data Types: There are seven different primitive data types in JavaScript. A primitive data type is one that has no properties or methods. data types are simply a way of holding values that would be later assigned to variables and/or functions for them to be worked on.

The primitive data types in JavaScript are:

  1. Strings e.g let str = "boy";

  2. Numbers e.g let num =9;

  3. Booleans - booleans can either be true or false e.g let isHungry = true;

  4. Undefined

  5. BigInt - Is used to store integers with arbitrary magnitude e.g

    const x = BigInt(Number.MAX_SAFE_INTEGER);

  6. Symbols e.g $, #, / etc

  7. Null

    you can learn more about these data types here.


You can learn more about array methods here.



You can learn more about asynchronous programming here.


the output should be:

    //Promise { <state>: "pending" }
    //Started Process…
    //Received response: 200

The Initial state of a promise is pending hence why the Initial output indicates that*.* The started process... seems to have been logged before the response. This is because fetch() returns while the request is still ongoing. The diagram below shows the life cycle of a promise



Conclusion

In conclusion, coding in JavaScript can get confusing, but as far as you ground yourself with the basic concepts and paradigms, the journey to becoming a great developer loses a lot of potholes. You should check out Mozilla's Documentation and freecodecamp.org's courses to get more information.

Thanks for reading!