Zephyr Coding

Javascript Basics 0 - What is Javascript?

November 20, 2017

Before we start with getting setup and actually writing some code, let’s take a bit of time to understand what Javascript actually is. Javascript is a programming language that is most commonly used in web browsers, but also is used in many other areas. Since we’re starting at the beginning, let’s talk about what a programming language is. A programming language at its core is simply a way of communicating to a computer what you want it to do. That can be anything from adding 2 and 2 together, all the way to making an attempt at predicting what stock will next hit it big. The language itself provides a well formatted syntax to write code in that represents a series of instructions for the computer to execute.

Compiled vs. Interpreted Languages

Javascript is an interpreted language, which means a separate program reads your program’s code and interprets it in order to know what to tell the actual computer to do. This is in contrast to compiled languages, which make use of what we call compilers which take your application’s code and translate it directly into a form that the computer can directly understand. Compiled languages are typically faster in terms of execution time, but are typically a bit more complex to get up and running.

Javascript in the Browser

Javascript code included in a web page is executed by the browser to perform various operations or modify/enhance the web page in some way. JS can do things like scroll the page to a particular part of the site, change the text on the page, perform web requests to display new data on the site, or an almost infinite number of additional tasks.

Javascript on the Server

Javascript can also be used on servers where web sites or applications are actually served from. It can handle the processing of web requests, access to databases, rendering of a website, and any other tasks that might need to be handled by the server.

Javascript in Desktop Applications

Frameworks exist to even use Javascript to program modern desktop applications. These frameworks allow you to use web technologies that you’re already familiar with to code a full desktop app that has access to all the platform functionalities, such as file system access, that typical applications have.

As you can see, Javascript is an incredibly popular language that has uses in almost any type of scenario. In our examples, we’ll be running Javascript locally on our computer to make it easier to test the code out without having to involve a browser.

In my opinion Javascript is a great language to start with for learning programming due to it’s relative ease in getting started and it’s huge community and user base. We’ll be covering the basics of Javascript in a way that gives you a working understanding of the language that’ll enable you to write programs of your own. As you progress, you’ll find out about all the litle intricacies of the language, but for now we’ll be concentrating on learning just enough to get you up and running.

Brian SchulteWritten by Brian Schulte