JavaScript Journey
wanqiang.ji@gmail.com
Nov 26, 2013
What?
•

a computer programming language
concurrent,class-based,object-oriented

JavaScript vs Java(Programming language)
...
Brief
•

Why?

Batting = Microsoft vs Netscape
Brendan Eich -> LiveScript
Sun Oracle

!

•

How?

prototype-based scriptin...
Syntax
Brendan Eich summarized the ancestry of the syntax in the first paragraph of the JavaScript 1.1 specification[1] as f...
Basics
•

Case sensitivity
!

!

•

It is common to start the name of a constructor with a capitalised letter, and the nam...
Variable
Variables in standard JavaScript have no type attached, and any value can be stored in any variable. Variables ar...
Primitive data types
•

Undefined

The value of "undefined" is assigned to all uninitialized variables, and is also returned...
Native Objects
•

Array
!

•

Date
!

•

Error
!

•

Math
!

•

Regular Expression
!

•

Function
Operators
•

Arithmetic

•

Assignment

•

Destructuring assignment

•

Comparison

•

Logical

•

Bitwise

•

String
Control Structures
•

if … else …

•

Switch … case …

•

for Loop

•

for … in loop

•

While loop

•

Do … while loop

•...
Functions
Reference
•

http://en.wikipedia.org/wiki/JavaScript#Server-side_JavaScript

•

http://en.wikipedia.org/wiki/Java_(program...
Upcoming SlideShare
Loading in...5
×

Javascript Journey

153

Published on

Javascript Journey,let's go to together.

Published in: Education, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
153
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Javascript Journey

  1. 1. JavaScript Journey wanqiang.ji@gmail.com Nov 26, 2013
  2. 2. What? • a computer programming language concurrent,class-based,object-oriented JavaScript vs Java(Programming language) ! • JavaScript vs Java(Software Platform) A set of serval computer software products and specifications from Sun Microsystems. ! ! • JavaScript vs Javanese Language Provide a system for developing application software and deploying it a cross-platform computing environment. Javanese People,Java island ! 75,500,000 people used it(more than 30% of total population in Indonesia) QA:What is JavaScript? JavaScript (JS) is an interpreted computer programming language.
  3. 3. Brief • Why? Batting = Microsoft vs Netscape Brendan Eich -> LiveScript Sun Oracle ! • How? prototype-based scripting language,dynamic typing,interpreted,weak typing Core:ECMAScript,DOM(Document Object Model),BOM(Browser Object Model) ! • When? ! • Whose? client-side:jQuery server-side:node.js desktop:CommonJS game:cocos2d-x Sun -> Oracle
  4. 4. Syntax Brendan Eich summarized the ancestry of the syntax in the first paragraph of the JavaScript 1.1 specification[1] as follows: JavaScript borrows most of its syntax from Java, but also inherits from Awk and Perl, with some indirect influence from Self in its object prototype system. • Basics • Objects • Variable • Exception handling • Primitive data types • Native Functions and Methods • Native objects • DOM • Operators • BOM • Control Structures • Libraries • Functions • References
  5. 5. Basics • Case sensitivity ! ! • It is common to start the name of a constructor with a capitalised letter, and the name of a function or variable with a lower-case letter. Spaces, tabs and newlines used outside of string constants are called whitespace. Unlike C, whitespace in JavaScript source can directly impact semantics. Because of a technique called "automatic semicolon insertion" (ASI), some statements that are well formed when a newline is parsed will be considered complete (as if a semicolon were inserted just prior to the newline). Whitespace and semicolons ! ! ! • Comments Comment syntax is the same as in C++ and many other languages.
  6. 6. Variable Variables in standard JavaScript have no type attached, and any value can be stored in any variable. Variables are declared with a var statement, multiple variables can be declared at once. Name Ruler:An identifier must start with a letter, underscore (_), or dollar sign ($); subsequent characters can also be digits (0-9). Because JavaScript is case sensitive, letters include the characters "A" through "Z" (uppercase) and the characters "a" through "z" (lowercase). Note that JavaScript's strict mode forbids the assignment of an undeclared variable, which avoids global namespace pollution.
  7. 7. Primitive data types • Undefined The value of "undefined" is assigned to all uninitialized variables, and is also returned when checking for object properties that do not exist. ! • Null Unlike undefined, null is often set to indicate that something has been declared but has been defined to be empty. ! • Number Numbers are represented in binary as IEEE-754 Doubles, which provides an accuracy nearly 16 significant digits. Because they are floating point numbers, they do not always exactly represent real numbers, including fractions. ! • String A string in JavaScript is a sequence of characters. In JavaScript, strings can be created directly by placing the series of characters between double or single quotes. ! • Alerts Alerts are a common Javascript feature. ! • Boolean JavaScript provides a Boolean data type with true and false literals.
  8. 8. Native Objects • Array ! • Date ! • Error ! • Math ! • Regular Expression ! • Function
  9. 9. Operators • Arithmetic • Assignment • Destructuring assignment • Comparison • Logical • Bitwise • String
  10. 10. Control Structures • if … else … • Switch … case … • for Loop • for … in loop • While loop • Do … while loop • With • Labels
  11. 11. Functions
  12. 12. Reference • http://en.wikipedia.org/wiki/JavaScript#Server-side_JavaScript • http://en.wikipedia.org/wiki/Java_(programming_language) • http://en.wikipedia.org/wiki/Java_(software_platform) • http://en.wikipedia.org/wiki/Javanese_script • http://www.w3schools.com/js/default.asp • http://en.wikipedia.org/wiki/JavaScript_syntax
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×