HNVN TR JavaScript 1-3 Presentation
HNVN TR JavaScript 1-3 Presentation
• Course overview.
• Course contents.
• Examination.
Course Overview
• Introduction to JavaScript.
• Why learn JavaScript?
• The fundamentals of JavaScript.
• JavaScript new features: ES2015 à ES2018.
Course Contents
• Primitive Values.
• Objects.
Primitive Values
• Boolean: true/false
• Number: 10, 3.14, …
• String: ‘abc’, …
• Null
• Undefined
• Symbol (ES2015)
Note: You can’t define your own primitive types.
Primitive Values
• Compared by value
Primitive Values
• Always immutable
Objects
• Compared by reference
Objects
• Mutable by default
Objects
• User-extensible
Null and Undefined
• undefined and null are the only values for which any kind of
property access results in an exception.
Null and Undefined
• Boolean
• Number
• String
Wrapper Objects for Primitives
• undefined, null
• Boolean: false
• Number: 0, NaN
• String: ''
• all objects are truthy
Operators
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators
Operators
Operators
- Two numbers are strictly equal when they are numerically equal (have
the same number value). NaN is not equal to anything, including NaN.
Positive and negative zeros are equal to one another.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
Operators
- Note that an object is converted into a primitive if, and only if, its
comparand is a primitive. If both operands are objects, they're
compared as objects, and the equality test is true only if both refer the
same object.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators
Operators
• Valid Identifiers.
https://mathiasbynens.be/notes/javascript-identifiers
Variables, Scope
• Constructors:
Object/Class
• Inheritance in JavaScript:
Array
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
DEMO
Q&A
Section 3
Asynchronous Programming, Events, Block scope variables, Constant
Asynchronous Programming
• Call Stack
Asynchronous Programming
• Event Loop
https://www.youtube.com/watch?v=8aGhZQkoFbQ
Asynchronous Programming
• Callback:
- Pros: Easy to understand (only for simple callback function).
• Callback:
Asynchronous Programming
• Callback:
Asynchronous Programming
• AJAX
Asynchronous Programming
https://jsbin.com/cibuyereme/edit?html,js,output
Event
• Event objects
https://jsbin.com/sugoviziyi/edit?html,js,output
Event
• Remove Listener
https://jsbin.com/jodiqafulu/edit?html,js,output
Block Scope Variables
• let
Block Scope Variables
• let
Block Scope Variables
• let
https://www.tiepphan.com/es2015-var-let-const-keywords/
Block Scope Variables
• const
https://www.tiepphan.com/es2015-var-let-const-keywords/
Block Scope Variables
• const
https://www.tiepphan.com/es2015-var-let-const-keywords/
Block Scope Variables
• const
https://www.tiepphan.com/es2015-var-let-const-keywords/
DEMO
Q&A
THANK YOU
www.nashtechglobal.com