Learning JavaScript: Development Environments for JavaScript Programming

Learning JavaScript: Development Environments for JavaScript Programming

One of the nice things about learning JavaScript these days is that there is a plethora of choices for writing and running JavaScript code. In this article, I’m going to describe a few of these environments and show you the environment I’ll be using in this series of articles.

One of the nice things about learning JavaScript these days is that there is a plethora of choices for writing and running JavaScript code. In this article, I’m going to describe a few of these environments and show you the environment I’ll be using in this series of articles.

Environment 1 — The Web Browser

The easiest way to run JavaScript is to simply use your web browser. You can either create an HTML page and put your JavaScript code inside a <script> tag, or you can use the browser’s developer tools to run your programs.

If you use HTML, here is a Hello, world! example to show you how your file should look (I’m skipping some HTML best practices to create a minimal system):

<!doctype html>
<html>
  <head>
  <script>
    alert("Hello, world!");
  </script>
  </head>
  <body>
  </body>
</html>

Save the file with a .html extension and then use the Open File command in your browser to load the page. “Hello, world!” will appear in a box in the browser.

The other way to run JavaScript programs in the browser is to use the browser’s developer tools. For Chrome and Firefox, if you press F12, the web developer console opens and you can input your programs here.

Look for the command prompt >>. Type your JavaScript commands there and hit Enter to have the browser evaluate your code.

Here is an example:

>> console.log("Hello, world!");
Hello, world!
-> undefined

undefined just means that the statement you ran didn’t assign a value to anything.

The Chrome browser’s developer tools work similarly.

javascript-development learning-to-cod javascript learning-to-program

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Learning JavaScript: Computing with Object Methods

JavaScript has a set of built-in methods you can use with your user-defined objects. In this article I’m going to discuss several of these methods and how you can use them in your JavaScript programs.

Learning JavaScript: Working with Objects — this, getters, and setters

JavaScript objects provide the reader with some special features that make object-based programmer more effective and more efficient. In this article I’m going to describe three of these features — the this keyword, getters, and setters. The this Keyword If there was ever a more confusing keyword in computer programming than thethiskeyword, I don’t know what it is.

Learning JavaScript: Data Types and Variables

To paraphrase the title of an old computer science textbook, “Algorithms + Data = Programs.” The first step in learning a programming language such as JavaScript is to learn what types of data the language can work with. The second step is to learn how to store that data in variables. In this article I’ll discuss the different types of data you can work with in a JavaScript program and how to create and use variables to store and manipulate that data.

Learning JavaScript: for Loops

In this article I’m going to cover the different forms of the for loop that are available in JavaScript. There is the general for loop, the for..in loop, and the for..of loop. I will describe how each loop works and when is the right time to use each loop type. I am leaving out the Array.forEach loop as it is specialized for arrays and requires some knowledge of functions I haven’t covered yet.

Learning JavaScript: Working with Strings

Strings are the second most common data type used in JavaScript, and in many cases, since JavaScript is so widely used for web applications, it is the prominent data type.