SlideShare una empresa de Scribd logo
1 de 24
OOPS in Javascript part 1
object?
object? instance of a type
instance of type dart frog
instances of type walrus
object? instance of a type type represents anything a dart frog or a walrus
how to create objects?
how to create objects? let’s start with creating a type… say ‘dartfrog’
how to create objects? let’s start with creating a type… say ‘dartfrog’ vardartfrog= function(){}
how to create objects? let’s start with creating a type… say ‘dartfrog’ vardartfrog= function(){} type
adding properties  andbehaviors
properties vardartfrog= function(){ this.name = ‘’; this.color = ‘’; this.poisonous = true;}
properties vardartfrog= function(){ this.name = ‘’; this.color = ‘’; this.poisonous = true;} properties
properties let’s fill the properties at the time of creation by passing values. vardartfrog= function(name, color, poisonous){ this.name = name; this.color = color; this.poisonous = poisonous;}
behaviors vardartfrog= function(name, color, poisonous){ this.name = name; this.color = color; this.poisonous = poisonous; this.jump = function(){ alert(“JUMP    JUMP     JUMP”);       } ; this.sing = function(){ alert(“CROAK    CROAK   CROAK”);       }      }
behaviors vardartfrog= function(name, color, poisonous){ this.name = name; this.color = color; this.poisonous = poisonous; this.jump = function(){ alert(“JUMP    JUMP     JUMP”);       } ; this.sing = function(){ alert(“CROAK    CROAK   CROAK”);       }      } Methods or behaviors
let’s create some frogs  and make them sing
creating objects varjackstraw = newdartfrog(“jackstraw”,                                                    “strawberry”,                                                    true);
creating objects varjackstraw = newdartfrog(“jackstraw”,                                                    “strawberry”,                                                    true); name color poisonous?
creating objects varjackstraw = newdartfrog(“jackstraw”,                                                    “strawberry”,                                                    true); varstickyellow= newdartfrog(“stickyellow“,                                                     “yellow”,                                                      true); varblueman= newdartfrog(“blueman“, “blue”,                                                       true);
calling methods Guys are you ready. come on sing!! jackstraw.sing(); stickyellow.sing(); blueman.sing(); CROAK CROAKCROAK CROAK CROAKCROAK CROAK CROAKCROAK
ThankYou

Más contenido relacionado

Destacado

BeLAUNCH2014 x HACKATHON week 3
BeLAUNCH2014 x HACKATHON week 3BeLAUNCH2014 x HACKATHON week 3
BeLAUNCH2014 x HACKATHON week 3Chan Lee
 
미티어 리엑티비티 ( reactivity of meteor )
미티어 리엑티비티 ( reactivity of meteor ) 미티어 리엑티비티 ( reactivity of meteor )
미티어 리엑티비티 ( reactivity of meteor ) seung-hyun Park
 
Javascript and Web Performance
Javascript and Web PerformanceJavascript and Web Performance
Javascript and Web PerformanceJonathan Jeon
 
1. 미티어의 폴더구조
1. 미티어의 폴더구조1. 미티어의 폴더구조
1. 미티어의 폴더구조seung-hyun Park
 
Google Apps를 활용한 Smart Work 구축
Google Apps를 활용한 Smart Work 구축Google Apps를 활용한 Smart Work 구축
Google Apps를 활용한 Smart Work 구축선진 장
 
Meteor Korea DEV School 1st day
Meteor Korea DEV School 1st dayMeteor Korea DEV School 1st day
Meteor Korea DEV School 1st dayseung-hyun Park
 
142 리눅스와 모바일 day1-track4_2_v1.5
142 리눅스와 모바일 day1-track4_2_v1.5142 리눅스와 모바일 day1-track4_2_v1.5
142 리눅스와 모바일 day1-track4_2_v1.5NAVER D2
 
Ksug2015 jpa4 객체지향쿼리
Ksug2015 jpa4 객체지향쿼리Ksug2015 jpa4 객체지향쿼리
Ksug2015 jpa4 객체지향쿼리Younghan Kim
 
몽고디비교육1일차
몽고디비교육1일차몽고디비교육1일차
몽고디비교육1일차seung-hyun Park
 
The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습Hyun-woo Park
 
[D2CAMPUS]JavaScript 다시 시작하기
[D2CAMPUS]JavaScript 다시 시작하기[D2CAMPUS]JavaScript 다시 시작하기
[D2CAMPUS]JavaScript 다시 시작하기NAVER D2
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web AnimationsChang W. Doh
 
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임KH Park (박경훈)
 

Destacado (20)

BeLAUNCH2014 x HACKATHON week 3
BeLAUNCH2014 x HACKATHON week 3BeLAUNCH2014 x HACKATHON week 3
BeLAUNCH2014 x HACKATHON week 3
 
미티어 리엑티비티 ( reactivity of meteor )
미티어 리엑티비티 ( reactivity of meteor ) 미티어 리엑티비티 ( reactivity of meteor )
미티어 리엑티비티 ( reactivity of meteor )
 
Javascript and Web Performance
Javascript and Web PerformanceJavascript and Web Performance
Javascript and Web Performance
 
3. collection
3. collection3. collection
3. collection
 
1. 미티어의 폴더구조
1. 미티어의 폴더구조1. 미티어의 폴더구조
1. 미티어의 폴더구조
 
5.router
5.router5.router
5.router
 
Google Apps를 활용한 Smart Work 구축
Google Apps를 활용한 Smart Work 구축Google Apps를 활용한 Smart Work 구축
Google Apps를 활용한 Smart Work 구축
 
6.accounts
6.accounts6.accounts
6.accounts
 
4. publish / subscribe
4. publish / subscribe4. publish / subscribe
4. publish / subscribe
 
Meteor Korea DEV School 1st day
Meteor Korea DEV School 1st dayMeteor Korea DEV School 1st day
Meteor Korea DEV School 1st day
 
142 리눅스와 모바일 day1-track4_2_v1.5
142 리눅스와 모바일 day1-track4_2_v1.5142 리눅스와 모바일 day1-track4_2_v1.5
142 리눅스와 모바일 day1-track4_2_v1.5
 
Querydsl
QuerydslQuerydsl
Querydsl
 
Ksug2015 jpa4 객체지향쿼리
Ksug2015 jpa4 객체지향쿼리Ksug2015 jpa4 객체지향쿼리
Ksug2015 jpa4 객체지향쿼리
 
2. template
2. template2. template
2. template
 
몽고디비교육1일차
몽고디비교육1일차몽고디비교육1일차
몽고디비교육1일차
 
The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습The MongoDB Strikes Back / MongoDB 의 역습
The MongoDB Strikes Back / MongoDB 의 역습
 
[D2CAMPUS]JavaScript 다시 시작하기
[D2CAMPUS]JavaScript 다시 시작하기[D2CAMPUS]JavaScript 다시 시작하기
[D2CAMPUS]JavaScript 다시 시작하기
 
알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations알아봅시다, Polymer: Web Components & Web Animations
알아봅시다, Polymer: Web Components & Web Animations
 
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
Hoons닷넷 좌충우돌 10년, 그리고 새로운 패러다임
 
Owasp에 대하여
Owasp에 대하여Owasp에 대하여
Owasp에 대하여
 

Último

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 

Último (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 

OOPS in javascript