SlideShare a Scribd company logo
JavaScript objects and functions
JAVASCRIPT 
OBJECTS & FUNCTIONS 
Victor Perez
/ INTRODUCTION
OBJECTS ⁄ 
INTRODUCING 
● string, number, boolean, null and undefined 
● Wrapper objects: String, Number and Boolean 
● Object, Function, Boolean, Error, EvalError, RangeError, ReferenceError, SyntaxError, 
TypeError, URIError, Number, Math, Date, String, RegExp, Array and JSON 
● Host objects 
● no class inheritance 
● prototype inheritance
FUNCTIONS ⁄ 
INTRODUCING 
● Objects 
● Function scope 
● this and arguments 
● constructor 
● prototype 
● return ( default: undefined )
/ OBJECTS
CREATE ⁄ 
OBJECTS 
● literal 
● constructor 
● Object.create
CONSTRUCTOR ⁄ 
OBJECTS 
● Object.constructor
/ PROTOTYPE
INTRODUCTION ⁄ 
PROTOTYPE 
● Inheritance 
● Any object 
● Prototype chain 
● Read inheritance 
● Write own property
⁄ EXAMPLE PROTOTYPE
⁄ EXAMPLE PROTOTYPE
PROTOTYPE ⁄ 
OBJECTS 
● Object.create
PROTOTYPE ⁄ 
OBJECTS 
● Object constructor
/ FUNCTIONS
STATEMENT ⁄ 
FUNCTIONS 
● function statement
EXPRESSION ⁄ 
FUNCTIONS 
● function expression 
● The name is only available inside the 
function
CONSTRUCTOR ⁄ 
FUNCTIONS 
● Function constructor 
○ eval 
○ global scope
/ THIS
THIS 
⁄ GLOBAL CONTEXT 
● Global object 
● window in the browser
THIS 
⁄ FUNCTION CONTEXT 
● non strict 
○ Global object 
● strict mode 
○ undefined
⁄ OBJECT METHOD THIS 
● Object of the method
⁄ CONSTRUCTOR THIS 
● Object of the new created object
⁄ CALL & APPLY THIS 
● First parameter will be bound to this 
● call 
● apply 
● convert it to an object
⁄ BIND THIS 
● returns the same function where this is the same as the first parameter 
● this can’t be changed
/ JAVASCRIPT
/ QUESTIONS?
THANKS
Ad

More Related Content

What's hot (20)

JavaScript - Chapter 4 - Types and Statements
 JavaScript - Chapter 4 - Types and Statements JavaScript - Chapter 4 - Types and Statements
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
Comparing Haskell & Scala
Comparing Haskell & ScalaComparing Haskell & Scala
Comparing Haskell & Scala
Martin Ockajak
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
Reem Alattas
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Andrea Zaza
 
JavsScript OOP
JavsScript OOPJavsScript OOP
JavsScript OOP
LearningTech
 
JavaScript - Chapter 5 - Operators
 JavaScript - Chapter 5 - Operators JavaScript - Chapter 5 - Operators
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
Brian Hsu
 
Datatype in JavaScript
Datatype in JavaScriptDatatype in JavaScript
Datatype in JavaScript
Rajat Saxena
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat Sheet
HDR1001
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Rangana Sampath
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
Raghavan Mohan
 
Javascript
JavascriptJavascript
Javascript
Gita Kriz
 
JavaScript operators
JavaScript operatorsJavaScript operators
JavaScript operators
Victor Verhaagen
 
Interface result set
Interface result setInterface result set
Interface result set
myrajendra
 
Scala - core features
Scala - core featuresScala - core features
Scala - core features
Łukasz Wójcik
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
Core concepts-javascript
Core concepts-javascriptCore concepts-javascript
Core concepts-javascript
Prajwala Manchikatla
 
From android/java to swift (3)
From android/java to swift (3)From android/java to swift (3)
From android/java to swift (3)
allanh0526
 
JavaScript - Chapter 4 - Types and Statements
 JavaScript - Chapter 4 - Types and Statements JavaScript - Chapter 4 - Types and Statements
JavaScript - Chapter 4 - Types and Statements
WebStackAcademy
 
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
 JavaScript - Chapter 9 - TypeConversion and Regular Expressions  JavaScript - Chapter 9 - TypeConversion and Regular Expressions
JavaScript - Chapter 9 - TypeConversion and Regular Expressions
WebStackAcademy
 
Comparing Haskell & Scala
Comparing Haskell & ScalaComparing Haskell & Scala
Comparing Haskell & Scala
Martin Ockajak
 
JavaScript Objects
JavaScript ObjectsJavaScript Objects
JavaScript Objects
Reem Alattas
 
JavaScript - Chapter 8 - Objects
 JavaScript - Chapter 8 - Objects JavaScript - Chapter 8 - Objects
JavaScript - Chapter 8 - Objects
WebStackAcademy
 
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Reactive Web Applications with Scala & Liftweb - CodeWeek 2015
Andrea Zaza
 
JavaScript - Chapter 5 - Operators
 JavaScript - Chapter 5 - Operators JavaScript - Chapter 5 - Operators
JavaScript - Chapter 5 - Operators
WebStackAcademy
 
Programming Android Application in Scala.
Programming Android Application in Scala.Programming Android Application in Scala.
Programming Android Application in Scala.
Brian Hsu
 
Datatype in JavaScript
Datatype in JavaScriptDatatype in JavaScript
Datatype in JavaScript
Rajat Saxena
 
JavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat SheetJavaScript Object Oriented Programming Cheat Sheet
JavaScript Object Oriented Programming Cheat Sheet
HDR1001
 
Introduction to JavaScript
Introduction to JavaScriptIntroduction to JavaScript
Introduction to JavaScript
Rangana Sampath
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
Raghavan Mohan
 
Interface result set
Interface result setInterface result set
Interface result set
myrajendra
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
Sehwan Noh
 
From android/java to swift (3)
From android/java to swift (3)From android/java to swift (3)
From android/java to swift (3)
allanh0526
 

Similar to JavaScript objects and functions (20)

JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3
Chris Farrell
 
JavaScript Introductin to Functions
JavaScript Introductin to FunctionsJavaScript Introductin to Functions
JavaScript Introductin to Functions
Charles Russell
 
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQLPOUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
Code for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJSCode for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJS
Riyadh Al Nur
 
Object oriented programming in java
Object oriented programming in javaObject oriented programming in java
Object oriented programming in java
Elizabeth alexander
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
TO THE NEW | Technology
 
Introduction of Object Oriented JavaScript
Introduction of Object Oriented JavaScriptIntroduction of Object Oriented JavaScript
Introduction of Object Oriented JavaScript
NexThoughts Technologies
 
Ruby
RubyRuby
Ruby
krupasuthar
 
JavaScript: Patterns, Part 1
JavaScript: Patterns, Part  1JavaScript: Patterns, Part  1
JavaScript: Patterns, Part 1
Chris Farrell
 
Javascript
JavascriptJavascript
Javascript
theacadian
 
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Jacek Gebal
 
Object Oriented Javascript
Object Oriented JavascriptObject Oriented Javascript
Object Oriented Javascript
NexThoughts Technologies
 
Learn TypeScript from scratch
Learn TypeScript from scratchLearn TypeScript from scratch
Learn TypeScript from scratch
Mohd Manzoor Ahmed
 
Best Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, IndiaBest Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, India
N Benchmark IT Solutions
 
Spock pres
Spock presSpock pres
Spock pres
elizhender
 
Advanced PHP Simplified
Advanced PHP SimplifiedAdvanced PHP Simplified
Advanced PHP Simplified
Mark Niebergall
 
Object oriented java script
Object oriented java scriptObject oriented java script
Object oriented java script
vivek p s
 
Extending Node.js using C++
Extending Node.js using C++Extending Node.js using C++
Extending Node.js using C++
Kenneth Geisshirt
 
Functional programming
Functional programmingFunctional programming
Functional programming
ijcd
 
Action Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot ApplicationsAction Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot Applications
Joris Kuipers
 
JavaScript: Patterns, Part 3
JavaScript: Patterns, Part  3JavaScript: Patterns, Part  3
JavaScript: Patterns, Part 3
Chris Farrell
 
JavaScript Introductin to Functions
JavaScript Introductin to FunctionsJavaScript Introductin to Functions
JavaScript Introductin to Functions
Charles Russell
 
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQLPOUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
POUG Meetup 1st MArch 2019 - utPLSQL v3 - Testing Framework for PL/SQL
Jacek Gebal
 
Code for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJSCode for kombol - Objects and Functions in JS and NodeJS
Code for kombol - Objects and Functions in JS and NodeJS
Riyadh Al Nur
 
Object oriented programming in java
Object oriented programming in javaObject oriented programming in java
Object oriented programming in java
Elizabeth alexander
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
TO THE NEW | Technology
 
Introduction of Object Oriented JavaScript
Introduction of Object Oriented JavaScriptIntroduction of Object Oriented JavaScript
Introduction of Object Oriented JavaScript
NexThoughts Technologies
 
JavaScript: Patterns, Part 1
JavaScript: Patterns, Part  1JavaScript: Patterns, Part  1
JavaScript: Patterns, Part 1
Chris Farrell
 
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Ukoug webinar - testing PLSQL APIs with utPLSQL v3
Jacek Gebal
 
Best Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, IndiaBest Angular JS training in Hyderabad, India
Best Angular JS training in Hyderabad, India
N Benchmark IT Solutions
 
Object oriented java script
Object oriented java scriptObject oriented java script
Object oriented java script
vivek p s
 
Functional programming
Functional programmingFunctional programming
Functional programming
ijcd
 
Action Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot ApplicationsAction Jackson! Effective JSON processing in Spring Boot Applications
Action Jackson! Effective JSON processing in Spring Boot Applications
Joris Kuipers
 
Ad

JavaScript objects and functions