Design Development JavaScript

JavaScript 101 – Intro

This is the first part of JavaScript 101 series where you can learn more about JavaScript and how to use it in web development. If you will face any struggles or not understand to something, use comments or contact me via twitter – AlexDevero. In this first part we will talk a bit about history of JavaScript and then jump right in and take a look at some code.

History

JavaScript was created by Brendan Eich in 1995. It first appeared in Netscape under name LiveScript. According to some stories, the change of JavaScript name was made for marketing purposes because Java was pretty hot technology back then. In ’97 JavaScript became standardized as ECMAScript. So whether you are using name JavaScript or ECMAScript, you are still talking about the same thing. The last stable version of JavaScript 1.8.5 and was released in 2003. In case of ECMAScript it is version 5.1 (6 and 7 are in development). Version 2.0 is in development for a while and some information and possible new features were released here and there.

After short tap into the history let’s talk about programming.

What will you need

To write JavaScript code you need some kind of text editor or IDE (integrated development environment). The simplest software is probably notepad (Windows) or something like TextEdit (Mac). If you rather want to use IDE, many options are available. Personally, I like brackects (free), Sublime Text (paid) and Notepad++ which like Notepad on steroids and is often used by programmers. The only thing that will probably matter and can help you to decide what software to use is autocomplete feature of IDEs. However I recommend you, if you chose IDE, to turn this feature off at least in the beginning to force yourself to remember the code you are writing and to depend more on you.

All JavaScript files will be saved as „js“ file type. To run these files you will need some browser.

IDE or Notepad it’s time to write some code!

Comments

It is maybe unussual, but the first thing we will talk about are comments. Who cares about ussual ways anyway. In JavaScript you have two types of comments – one line and multiline (also called block).

One line comment begins with two slashes “//” and, as its name says, apply only to one line. So, when you break a line, only text on the same line as slashes will be commented.

JavaScript:

// This is a one line comment - this text is commented out
this text is NOT commented out

Multiline or block comments will probably familiar to you if you already know CSS. They begin with slash and star – “/*” and end with star and slash – “*/”. Just like in CSS. Multiline comment will apply to any text written inside it no matter over how many lines it spans.

JavaScript:

/* This is 
a
multiline
comment - this text is commented
out
*/

Summary

In this first part we talked about history of JavaScript, software you will need for development and we also learned something about comments. In next part we will take a look at basic methods and other great stuff.

If you liked this article, then please consider subscribing.

4 thoughts on “JavaScript 101 – Intro”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.