SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

En vedette

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 (박경훈)
 

En vedette (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에 대하여
 

Dernier

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demoHarshalMandlekar2
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 

Dernier (20)

[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Sample pptx for embedding into website for demo
Sample pptx for embedding into website for demoSample pptx for embedding into website for demo
Sample pptx for embedding into website for demo
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 

OOPS in javascript