Progressive Full Stack Application Development with Live Projects

JavaScript

Getting Started with JavaScript

Getting Started with JavaScript
  • Getting started with your first JavaScript Program

Writing JavaScript Code

The code that programmers write is called Source Code. As JavaScript is a high level language, programmers write (almost english like) their source code in a file with an extension of js.

To start writing our Javascript programs we can use any TextEditor software like NotePad or Sublime Text . If you are a beginner and have just started to learn any TextEditor you already use should be fine. If you are beginning on the Windows Platform, NotePad++ is a lightweight TextEditor software to begin with.

As you proceed and Get Started with creating some real JavaScript projects you can use a more complex Code Editors like Visual Studio Code which comes with additional functionalities and greater capabilities.

Running JavaScript in Browser

Before writing our first Javascript program let us discuss some aspects of JavaScript Language. JavaScript can run on Browsers. And we will be starting with writing JS code that will be interpreted in a browser.

So lets create a HTML Web Page (index.html). Now create a JavaScript program (script.js) and add this js script reference into our webpage (index.html) so that Browsers will be able to load the linked JavaScript code and interpret them.

Once you click the generated index.html file it will run on your default browser.

Running JavaScript outside Browser

Another way to run JavaScript is to run it outside the browser. Node . If you are are interested in learning server side programming, you can also try Running JavaScript with Node. You will need to install Node JS (a JavaScript Runtime) to run your Javascript code outside the context of a browser. In this context JavaScript can be written to create server applications.

Leave a Reply