Learn JavaScript - freedom and power

Saturday, October 11, 2014

JavaScript is a cross platform, object oriented scripting language

JavaScript is the most popular programming language used on the web

Everything runs on JavaScript. Invented by Netscape.

Characteristics:

  1. JavaScript controls the browser and the document object model
  2. JavaScript contains objects such as Arrays, Date and Math
  3. JavaScript contains language elements such as operators, control structures, and statements
  4. Server Side JavaScript communicates with relational databases and performs file manipulation on the server
  5. Inside its host, JavaScript can provide programmatic control over the objects in its environment
  6. Great Software built with JavaScript: AngularJS, node.js, CouchDB...

I encourage you to type in all instructions and look in developer console. Learning is best when keying in all code and through trial and error.
Have fun and enjoy learning JavaScript.


There are 5 types of primitive values


JavaScript is dynamically typed, not necessary to specify the data type of a variable upon declaration, data types are automatically converted


Let's convert some strings to numbers


Variables


A variable declared outside a function is a global variable, a variable declared in a function is a local variable


Literals are used to represent values, such as array literals, object literals, string literals


String literals are zero or more characters enclosed in double or single quotes


Operators and Operands


More operators


Control flow for interactivity on the web page


Loop statements are a set of commands that execute repeatedly until a specified condition is met


Control flow continued


Function consists of function keyword, name of function, list of arguments, statements that define function in curly braces


Function Scope


More functions


Object is a standalone entity with properties and type

Default Success Warning Important Info Inverse
B S W I ? O