Introduction to JavaScript
Where did JavaScript come from?
Origins
Created by Brendan Eich at Netscape in 1995
Has been standardized in the ECMAScript specification since the late 90's
It's not related to Java!
Prevalence
HTML, CSS, and JavaScript have been the 3 core languages making up modern web pages
It is supported by all modern web browsers
Also used in desktop programs (widgets)
Programming/Scripting
The main difference between programming and scripting is that scripting languages (like JavaScript!) don't have to be compiled
They also have less access to your computer's machine (like memory allocation)
JavaScript is:
- An interpreted language (i.e. not compiled)
- Object-Based (modular)
- Similar to C++ and Python in how you write code
Libraries
Pre-written JavaScript which allows for easy development
They let you create robust web application easily. Someone else has done all the hard work!
Let's go!
We'll focus on web-based JavaScript (since that's the majority of where you'll encounter and use it)
Find that code editor you installed and open it up!
Create an HTML file
- Create a new html file on your computer
- Open it in your code editor
- Add the following to your html file
- Open your html file in your web browser
- Add the following to your html file
Display the result here.