JS 4 U

60 %
40 %
Information about JS 4 U
Technology

Published on March 3, 2014

Author: mkinawy

Source: slideshare.net

Description

Basics of programming/developing, with JavaScript

JS4U Basics of programming, using JavaScript

Md. Kinawy Pragmatic Programmer • 8+ years in web dev. & 12+ years in IT • Originally Microsoft stack • Shifted recently to the awesomeness: • Freelance ONLY • Node.js (JS) • website: http://besawa.com • blog: http://besawa.com/blog • email: mkinawy@besawa.com • twitter: @besawa_official

Programming Basics

Story of compiler Grace Hopper [1906 –1992]: http://en.wikipedia.org/wiki/Grace_Hopper

Linear Execution  var x = 7; var y = 3; var z = x + y; x = 2; alert(z);  Exceptions: Loops Calls Returns Exceptions Flow Control

Syntax and components  Types  Objects  Variables  Functions/Methods  Arrays/Collections  Public vs Private  Member vs Static  OOP  Events

Strongly-Typed vs Dynamic programming languages  Intellisense  Debugging  Conversion  Extending

Developing (what?) Tools  Editor  Debugging  Logging  Source Control  IDE  Host  Tracker  Service Oriented Arch.

JavaScript

Intro  1995 - 2009: for only client side  Web explosion + web browsers war  Super client side apps  Very dynamic language  Callback language, aka functional language  Could be used for any app of any kind, depends on the engine/executer: For gaming: ex. Unity3D Service layer: ex. Node.js Dom manipulator: ex. jQuery Mobile apps: ex. Phonegap Linux programming: ex. Gnome

Demo Hello JS!

Operators  alert(“Hello World!”): {} ;  var foo = int > foo = function  console.log(foo) | alert(foo)  Numeric Operators: + - * / Self operators: += ++ string + int: “2” + 1 = ?  Comparison Operators: == != === !== > >= < <=  Logical Operators: && || true and false, truthy and falsy

Conditional blocks  Flow Control: if-else Ternary Operator: xx ? yy : zz  Switch Statements: switch case break default

Loops  Initiation – Condition – Iteration – Body  while Loop  do-while Loop  for Loop  break  continue

Arrays  var myArr = [„hello‟, „world‟];  myArr[0] | myArr[2]  myArr.length;  myArr[1] = „qafeer‟;  myArr.push(„!‟);

Objects  Very dynamic objects: I REALLY LOVE JS  var myObj = { name: „MK‟, age: „NOT UR BZ‟, getEmail: function(){ return „info@besawa.com‟ } };  myObj.name;  myObj.getEmail();

Functions  function welcome(name) { return “Hello “ + name + “!”; }  welcome(„Md. Kinawy‟) | welcome()  return vs void  Self executing anonymous functions  Functions as arguments, aka callbacks: name | anonymous

Scope  Variable outside function  Variable inside function  Two variables with the same name, one outside and other inside  Closures

Add a comment

Related presentations

Related pages

JS 4 U 12: Prompters : James Robertson : Free Download ...

Today we look at the various prompting dialog boxes that can be popped up from Javascript - the built on ones, not anything from a library
Read more

JS-4 - Wikipedija

JS-4; JS-4 u muzeju tenkova Kubinka, Rusija. Namjena: Teški tenk: Zemlja porijekla: SSSR: Povijest proizvodnje; Dizajn: L. S. Trojanov: Razvijen na ...
Read more

JS 4 U 14: Looping : James Robertson : Free Download ...

A brief Overview of Looping in Javascript ... Search the history of over 279 billion web pages on the Internet.
Read more

JS 4 U 19: Events : James Robertson : Free Download ...

A brief overview of web page based events in Javascript
Read more

JS 4 U 23: The Date Class in Javascript : James Robertson ...

An overview of the Date object in Javascript
Read more

JS 4 U 20: Escaping Text in Javascript : James Robertson ...

How to escape special characters in Javascript strings
Read more

JS 4 U 18: Throwing Exceptions : James Robertson : Free ...

How to throw exceptions in Javascript, and then catch them by name
Read more

JS 4 U 21: Strings in Javascript : James Robertson : Free ...

An overview of class string in Javascript - a look at some of the methods available to you
Read more

JS 4 U 22L More on Javascript Strings : James Robertson ...

Today we continue examining the various useful methods supported by the Javascript String class
Read more

JS 4 U 25: The Boolean Object : James Robertson : Free ...

An overview of boolean objects in Javascript ... Search the history of over 510 billion pages on the Internet.
Read more