Most modern operating systems support the ability for you to install and setup a browser. If you are running windows then IE is pre-installed, if you running Linux you might get Chrome or Midori for OSX users you will have Safari pre-installed.
The rest of this book will focus on using Chrome. If your computer does not have chrome installed you can download the latest version below.
Hold on! What about the rest of the browsers? Great question! this is one of the many decisions that you must take in order for you to create the “Perfect development environment”. Here is a list of the most popular web browsers for 2016.
- Firefox
- Chrome
- Opera
- Safari
- Internet Explorer
- Torch
- Midori
Tip: If you decide to be a web developer in the future you will have to support this list of browsers, and much more.
The JavaScript console
The JavaScript console provides you the ability to log messages, enter an executable code or evaluate regular JavaScript expressions.
How to open the console?
The JavaScript Console can be accessed in three different places.
- Use the keyboard
- Mac
- Windows and Linux
- Mac
- Use the Menu
- Use the Mouse
- Right click anywhere inside a webpage and select inspect
- Right click anywhere inside a webpage and select inspect
Now that you know how to open the console, this will be used later when creating your first JavaScript program.
The Text Editors
In your local environment, the operating system will provide you with a text editor that is pre-installed. Below you will find the list of the most common text editors that are included in your operating system.
Windows: In Windows 7 you will have an application named Notepad
Can I use Pages, LibreOffice or Microsoft Word to write code?: Yes, and No, although each of this applications allows you to use them as text editors, their main purpose is to be used as a word processor, not a text editor. The difference is that word processor will add extra information to the files that are saved, typically metadata such as formatting, font colors, font types etc. Your JavaScript programs won’t requires any of this. This another decision that you must make to find your “Perfect development environment”.
Running a simple program
Your browser requires an HTML
page in order for it to be rendered inside the browser. JavaScript requires being inside an HTML
page in order for the browser to interpret the JavaScript Code.
hello.html
file
<script type="text/javascript" src="hello.js" async></script>
hello.js
file
console.log('Hello World');
Now just double click the hello.html
file and open the console and you will have a message saying Hello World
. That’s all there is to running a program with your local environment.
I always had a passion for the field of STEM (Science, Technology, Engineering, and Math) and I knew I wanted to do something to make a difference in the world. I just didn’t know where to start. I was an immigrant in a new country, grew up in a tough environment, and wasn’t sure how… Read More