University of Kurdistan

Slides:



Advertisements
Similar presentations
The JavaScript Programming Language
Advertisements

JavaScript I. JavaScript is an object oriented programming language used to add interactivity to web pages. Different from Java, even though bears some.
the javascript language BY SA.
Air Force Institute of Technology Electrical and Computer Engineering
Operators and Expressions Operators are symbols that produce a result based on some rules. Examples: +, -, =, > and
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
Javascript Client-side scripting. Up to now  We've seen a little about how to control  content with HTML  presentation with CSS  Javascript is a language.
1 Chapter 4 Language Fundamentals. 2 Identifiers Program parts such as packages, classes, and class members have names, which are formally known as identifiers.
JavaScript, Third Edition
Copyright © 2003 ProsoftTraining. All rights reserved. Sun Certified Java Programmer Exam Preparation Guide.
4. Python - Basic Operators
CISC474 - JavaScript 03/02/2011. Some Background… Great JavaScript Guides: –
2440: 211 Interactive Web Programming Expressions & Operators.
Java Tutorial. Object-Oriented Programming Concepts Object –a representation of some item state  fields/members and should be encapsulated behavior 
Chapter 3: Data Types and Operators JavaScript - Introductory.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
C Derived Languages C is the base upon which many build C++ conventions also influence others *SmallTalk is where most OOP comes Java and Javascript have.
Basic Operators. What is an operator? using expression is equal to 9. Here, 4 and 5 are called operands and + is the operator Python language supports.
Hello.java Program Output 1 public class Hello { 2 public static void main( String [] args ) 3 { 4 System.out.println( “Hello!" ); 5 } // end method main.
Java Script: Arrays (Chapter 11 in [2]). 2 Outline Introduction Introduction Arrays Arrays Declaring and Allocating Arrays Declaring and Allocating Arrays.
4.4 JavaScript (JS) Deitel Ch. 7, 8, 9, JavaScript & Java: Similarities JS (JavaScript) is case-sensitive Operators –arithmetic: unary +, unary.
Controlling Program Flow. Data Types and Variable Declarations Controlling Program Flow.
15-Nov-15 All the Operators. operators.ppt 2 Precedence An operator with higher precedence is done earlier (precedes) one with lower precedence A higher.
05 – Java Script (1) Informatics Department Parahyangan Catholic University.
Chapter 14 JavaScript: Part II The Web Warrior Guide to Web Design Technologies.
2: Basics Basics Programming C# © 2003 DevelopMentor, Inc. 12/1/2003.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Introduction to JavaScript academy.zariba.com 1. Lecture Content 1.What is JavaScript? 2.JavaScript Pros and Cons 3.The weird JavaScript stuff 4.Including.
Internet & World Wide Web How to Program, 5/e © by Pearson Education, Inc. All Rights Reserved.
Introduction to Calculated Columns Variables, Conditionals, and String Manipulation PRESENTER: Cameron Blashka| Informer Implementation Specialist| April.
Key Words / Reserved Words
CHAPTER 4 CLIENT SIDE SCRIPTING PART 1 OF 3
University of Central Florida COP 3330 Object Oriented Programming
University of Central Florida COP 3330 Object Oriented Programming
Variables and Arithmetic Operators in JavaScript
C++, OBJECT ORIENTED PROGRAMMING
SEEM4570 Tutorial 05: JavaScript as OOP
JavaScript Fundamentals
JavaScript for C++ and Java Programmers
C Short Overview Lembit Jürimägi.
Expressions and Control Flow in JavaScript
String Conversion and Type Juggling
Primitive Types Vs. Reference Types, Strings, Enumerations
Chapter 19 JavaScript.
11/10/2018.
Web Systems Development (CSC-215)
Modern JavaScript Develop And Design
Starting JavaProgramming
null, true, and false are also reserved.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
All the Operators 22-Nov-18.
Chapter 8 JavaScript: Control Statements, Part 2
Variables and Arithmetic Operators in JavaScript
All the Operators 4-Dec-18.
JavaScript Data Concepts
PHP.
CS5220 Advanced Topics in Web Programming JavaScript Basics
Tutorial 4 JavaScript as OOP Li Xu
JavaScript Reserved Words
CS5220 Advanced Topics in Web Programming Node.js Basics
All the Operators 6-Apr-19.
JavaScript CS 4640 Programming Languages for Web Applications
All the Operators 13-Apr-19.
OOP With Java/ course1 Sundus Abid-Almuttalib
The <script> Tag
ENERGY 211 / CME 211 Lecture 5 October 1, 2008.
C Language B. DHIVYA 17PCA140 II MCA.
Web Programming and Design
JavaScript CS 4640 Programming Languages for Web Applications
Presentation transcript:

University of Kurdistan Java Script Farid Mohammadi University of Kurdistan

Contents Introduction Data Primitive Operations Control flow and error handling Data Control Storage Management Operating Environment Modern java script

Introduction Java Script Releas in May 1995 by Brendan Eich High-level, interpreted programming language Event-driven, functional, and imperative (including object-oriented) Has an API for working with text, arrays, dates, regular expressions, and basic manipulation of the DOM

ECMA Script

ES6 reserved keywords typedef var void await break case catch class continue debugger default delete do else export extends finally for function if import in instanceof new return super switch this throw try typedef var void while with yield

Data Undefined Null Boolean String Number Object

Data

Primitive Operations Arithmetic operators Comparison Operators Logical Operators Bitwise Operators Assignment Operators Miscellaneous operators

Arithmetic operators Operator Meaning + Add - Subtract -expr Unary minus, also known as negation (reverse the sign of the expression) * Multiply / Divide % Remainder of an integer division ++ Increases an integer value by one -- Decreases an integer value by one

Comparison Operators Operator Meaning == Equal === != Not Equal > Greater than < Less than >= Greater than or equal to <= Less than or equal to

Logical Operators Operator Meaning Logical AND Logical OR Logical NOT && Logical AND || Logical OR ! Logical NOT

Bitwise Operators Operator Meaning BitWise AND BitWise OR Bitwise XOR & BitWise AND | BitWise OR ^ Bitwise XOR ~ Bitwise Not << Left Shift >> Right Shift >>> Right shift with Zero

Assignment Operators >>>= = /= ^= += %= |= −= <<= &= *=

Miscellaneous Operator Name Meaning () Function application Represents a function call [] Object access Refers to the value at the specified index in the object . Member access Refers to a property of an expression; example: foo.bar selects property bar from expression foo ? Conditional member access If Condition is true? Then value X : Otherwise value Y

Control flow and error handling if and else switch and case Falsy values false undefined null NaN the empty string ("")

Control flow and error handling throw expression try...catch statement

Loops and iteration for statement do...while statement while statement labeled statement break statement continue statement for...in statement for...of statement

Call by value vs Call by reference

Call by value vs Call by reference primitives (Number, String, etc) are always pass-by-value Javascript is pass-by-reference for objects

Dynamic type checking vs static Use static type checking with flow

Scope globally-scoped variable Local scope Automatically Global

Memory Management Low-level languages, like C, have low-level memory management primitives like malloc() and free(). JavaScript values are allocated when things (objects, strings, etc.) are created and "automatically" freed when they are not used anymore. The latter process is called garbage collection.

Standard built-in objects Object.length Object.assign() Object.values() … Number  Number.MAX_VALUE Number.NaN Number.isNaN() Number.parseInt() …

Standard built-in objects Math Math.PI Math.sin(1.56) Math.abs() … String indexOf(), lastIndexOf() Slice() Trim() Substring(), substr() …

Indexed collections Array methods concat() join(delimiter = ',’) push() reverse()

Keyed collections Map

Keyed collections Set

Functions

Functions

Prototype

Classes

Classes

Modern Java script

Modern Java script

Modern Java script

Modern Java script

Modern Java script

Modern Java script

Modern Java script

Configuring a basic environment npm install -g babel-cli npm install --save-dev babel-cli babel-preset-es2015 babel-preset-stage-0 babel example.js --out-file compiled.js