Разделы презентаций


Module 1: Introduction to JavaSript D. Petin 04/2014

AgendaBasic InformationIncluding JS Code into HTMLCommentsVariablesData TypesType Casting

Слайды и текст этой презентации

Слайд 1Module 1: Introduction to JavaSript


D. Petin

04/2014

Module 1:  Introduction to JavaSriptD. Petin04/2014

Слайд 2Agenda
Basic Information
Including JS Code into HTML
Comments
Variables
Data Types
Type Casting

AgendaBasic InformationIncluding JS Code into HTMLCommentsVariablesData TypesType Casting

Слайд 3
Basic Information

Basic Information

Слайд 4Basic information
JavaScript - dynamic computer programming language.

It is most commonly

used as part of web browsers, whose implementations allow client-side

to interact with the user, control the browser and asynchronously communicate with server-side.

JavaScript syntax was influenced by C.
Basic informationJavaScript - dynamic computer programming language.It is most commonly used as part of web browsers, whose

Слайд 5Basic information
JS take many names and naming conventions from Java,

but the two languages are otherwise unrelated and have very

different semantics.

JavaScript is a prototype-based scripting language with dynamic typing.

JS supported object-oriented, imperative and functional programming styles.

[1]

[2]

[3]

Basic informationJS take many names and naming conventions from Java, but the two languages are otherwise unrelated

Слайд 6
Including JS Code into HTML

Including JS Code into HTML

Слайд 7Including of JavaScript
Exist three ways to include script into HTML

page:

Inline in HTML
Inside tag
In separate

file

[1]

[2]

[3]

Including of JavaScriptExist three ways to include script into HTML page: Inline in HTML Inside tag In

Слайд 8Inline including
….

Unfortunately, this is the worst

solution.
Holistic code will be broken into smaller parts.
Such

parts are difficult to test and maintain. :(
Inline including…. Unfortunately, this is the worst solution. Holistic code will be broken into smaller parts. Such

Слайд 9Inside tag

f() ;

Sometimes it makes sense.
But in the

general case, page size will be increased
and, as a result,

its performance reduced.
Inside tag f() ;Sometimes it makes sense. But in the general case, page size will be increasedand,

Слайд 10In separate file
This is the best way.
Code is holistic.

It’s easy to test and maintain.
In addition, separated files

are cached by the browser.
This improves performance. :)


In separate fileThis is the best way. Code is holistic. It’s easy to test and maintain. In

Слайд 11
Comments

Comments

Слайд 12Comments
Comments - part of the program text which will be

ignored by language interpreter

The /* characters, followed by any sequence of

characters (including new lines), followed by the */ characters.
The // characters, followed by any sequence of characters, but only in current line. Therefore, it is commonly called a "single-line comment."


[1]

[2]

[3]

CommentsComments - part of the program text which will be ignored by language interpreter The /* characters, followed by

Слайд 13
Variables

Variables

Слайд 14Variables
Variable – symbolic name associated with a value and whose

associated value may be changed.
Declaration – process of variable's specifying.

Usually declaration consist of defining: type, name and default value of variable.

A process in which a variable is set to its first value is called initialization.

[1]

[2]

[3]

VariablesVariable – symbolic name associated with a value and whose associated value may be changed.Declaration – process

Слайд 15Declaration and initialization
var – special keyword for declaration of variables
In

JavaScript
var variable; //declaration
variable = 10;

//initialization

Or quickly

var variable = 10;

[1]

[2]

[3]

Declaration and initializationvar – special keyword for declaration of variablesIn JavaScriptvar variable;    //declarationvariable =

Слайд 16Global and local
JavaScript has two types of variables:

global -

exist in memory and is available at all times of

the program. In JS it's a variables of page.
local - exist in memory and is available only in block when variable is defined. In JS it's defined in function variables.

[1]

[2]

Global and localJavaScript has two types of variables: global - exist in memory and is available at

Слайд 17
Data Types

Data Types

Слайд 18Data types
JavaScript have 6 base data types:

Number – scalar

type for integer and real digits
Boolean – scalar type

for logical values
String – special type for work with text information
Undefined – special type for uninitialized variables
Null – special type for "cleaning" of variables
Object – complex type for service and user needs
Data typesJavaScript have 6 base data types: Number – scalar type for integer and real digits Boolean

Слайд 19Number, Boolean and String
var n = 10; or var n

= Number(10);
//number values for example: -1, 10, 3.14, Nan,

Infinity

var s = “text”; or var s = String(“text”);
//string values for example: “”, “text”, ‘text’

var b = true; or var b = Boolean(true);
//bollean values: true and false

[1]

[2]

[3]

Number, Boolean and Stringvar n = 10; or var n = Number(10); //number values for example: -1,

Слайд 20Null and Undefined
var n = null;
//null variables can have

only null value
var u;
// created and uninitialized
And Object type…

but it will be reviewed in future :)

[1]

Null and Undefinedvar n = null; //null variables can have only null valuevar u; // created and

Слайд 21
Type Casting

Type Casting

Слайд 22Type casting
Compression

Expanding
Type casting      Compression

Слайд 23Type casting
var a, b, c;
a = 10;
b =

true;
c = a + b;
var a, b, c;
a

= 10;
b = true;
c = a + Number(b);

Exist two types of casting:

Implicit

Explicit

But both ways given c =11 as a result!

[2]

[1]

[3]

Type castingvar a, b, c; a = 10; b = true; c = a + b;var a,

Слайд 24Type casting
Base rules of typing casting:

All scalar types try to

convert itself to largest scalar type: Boolean to Number, Number

to String.
If Boolean converted to String it at first converted to Number and after them Number to String.
In mathematical operations (excluding +) String should be converted to Number.
Null and Undefined converted to String as “null” and “undefined”, and to Number as a 0 and NaN

[1]

[2]

[3]

[4]

Type castingBase rules of typing casting:All scalar types try to convert itself to largest scalar type: Boolean

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика