SlideShare a Scribd company logo
1 of 13
Learn you some JavaScript for the
great good
Why learn you JavaScript?
It's such awesome!
Why such awesome?
●

Closures

●

Functions is first class such power

●

So fast
Goal of lesson
●

Understand:

function Person (name) {
this.name = name;
}
Person.prototype.getName = function () {
return this.name;
}
●

Wow very function
So variables in JavaScript
●

Variables are declared:
var doge = 'doge';

●

Data types:
1. Number
2. Object
3. Array
4. Strings
5. Booleans
Much examples
var dog = 'doge';
var dog = {name: 'doge'};
var dog = ['dog'];
var isDoge = true;
var numDoge = 1; //only one doge!
Wow Objects
var person = {name: 'Bill',
age: 33};
console.log(person.name) //'Bill'
console.log(person.age) //33
Much Functions
function doFizzBuzz (range) {
var i = 0,
toReturn = '';
for (i = 0; i < range; i++) {
if (i % 3 === 0) {
toReturn += 'Fizz';
}
if (i % 5 === 0) {
toReturn += 'Buzz';
}
toReturn += 'n';
}
return toReturn;
}
Functions === Objects
Much idiomatic
function doFizzBuzz (range) {
var i = 0;
for (i = 0; i < range; i++) {
if (i % 3 === 0) {
this.result += 'Fizz';
}
if (i % 5 === 0) {
this.result += 'Buzz';
}
this.result += 'n';
}
}
Much high order function
//interval stores the id of this interval
var interval = window.setInterval(function () {
if (this.isVisible === true) {
document.getElementById('change').style.visibility = 'hidden';
this.isVisible = false;
} else {
document.getElementById('change').style.visibility = 'visible';
this.isVisible = true;
}
}, 500);

More Related Content

Viewers also liked

Viewers also liked (9)

JAWS−UG中央線の紹介
JAWS−UG中央線の紹介JAWS−UG中央線の紹介
JAWS−UG中央線の紹介
 
Slide Share
Slide ShareSlide Share
Slide Share
 
Real Options in Drug Discovery
Real Options in Drug DiscoveryReal Options in Drug Discovery
Real Options in Drug Discovery
 
AWSを選択する理由
AWSを選択する理由AWSを選択する理由
AWSを選択する理由
 
Technology that is used in “Skybrain”
Technology that is used in “Skybrain”Technology that is used in “Skybrain”
Technology that is used in “Skybrain”
 
Web API Next Challenge
Web API Next ChallengeWeb API Next Challenge
Web API Next Challenge
 
日本一遅い re:Invent 2015 社内報告会
日本一遅い re:Invent 2015 社内報告会日本一遅い re:Invent 2015 社内報告会
日本一遅い re:Invent 2015 社内報告会
 
Serverless で位置情報を活用する
Serverless で位置情報を活用するServerless で位置情報を活用する
Serverless で位置情報を活用する
 
JAWS-UGとは?
JAWS-UGとは?JAWS-UGとは?
JAWS-UGとは?
 

Similar to Learnjs

LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: Intro
Adam Crabtree
 

Similar to Learnjs (20)

Javascript tid-bits
Javascript tid-bitsJavascript tid-bits
Javascript tid-bits
 
ES6
ES6ES6
ES6
 
Awesomeness of JavaScript…almost
Awesomeness of JavaScript…almostAwesomeness of JavaScript…almost
Awesomeness of JavaScript…almost
 
LinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: IntroLinkedIn TBC JavaScript 100: Intro
LinkedIn TBC JavaScript 100: Intro
 
JavaScript For CSharp Developer
JavaScript For CSharp DeveloperJavaScript For CSharp Developer
JavaScript For CSharp Developer
 
Javascript basics
Javascript basicsJavascript basics
Javascript basics
 
Week3
Week3Week3
Week3
 
Groovy.pptx
Groovy.pptxGroovy.pptx
Groovy.pptx
 
JavaScript Inheritance
JavaScript InheritanceJavaScript Inheritance
JavaScript Inheritance
 
"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues"Javascript" por Tiago Rodrigues
"Javascript" por Tiago Rodrigues
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
The JavaScript Programming Primer
The JavaScript  Programming PrimerThe JavaScript  Programming Primer
The JavaScript Programming Primer
 
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
Exploring Ceylon with Gavin King - JUG BB Talk - Belrin 2014
 
JavaScript In Object Oriented Way
JavaScript In Object Oriented WayJavaScript In Object Oriented Way
JavaScript In Object Oriented Way
 
Everything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-insEverything is Permitted: Extending Built-ins
Everything is Permitted: Extending Built-ins
 
Learn JavaScript From Scratch
Learn JavaScript From ScratchLearn JavaScript From Scratch
Learn JavaScript From Scratch
 
Advanced JavaScript
Advanced JavaScriptAdvanced JavaScript
Advanced JavaScript
 
Introduction To Moose
Introduction To MooseIntroduction To Moose
Introduction To Moose
 
The many facets of code reuse in JavaScript
The many facets of code reuse in JavaScriptThe many facets of code reuse in JavaScript
The many facets of code reuse in JavaScript
 
Javascript development done right
Javascript development done rightJavascript development done right
Javascript development done right
 

Recently uploaded

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
panagenda
 
+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...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
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
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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
 
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...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
+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...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
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
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

Learnjs

  • 1. Learn you some JavaScript for the great good
  • 2. Why learn you JavaScript? It's such awesome!
  • 3. Why such awesome? ● Closures ● Functions is first class such power ● So fast
  • 4. Goal of lesson ● Understand: function Person (name) { this.name = name; } Person.prototype.getName = function () { return this.name; } ● Wow very function
  • 5.
  • 6. So variables in JavaScript ● Variables are declared: var doge = 'doge'; ● Data types: 1. Number 2. Object 3. Array 4. Strings 5. Booleans
  • 7. Much examples var dog = 'doge'; var dog = {name: 'doge'}; var dog = ['dog']; var isDoge = true; var numDoge = 1; //only one doge!
  • 8.
  • 9. Wow Objects var person = {name: 'Bill', age: 33}; console.log(person.name) //'Bill' console.log(person.age) //33
  • 10. Much Functions function doFizzBuzz (range) { var i = 0, toReturn = ''; for (i = 0; i < range; i++) { if (i % 3 === 0) { toReturn += 'Fizz'; } if (i % 5 === 0) { toReturn += 'Buzz'; } toReturn += 'n'; } return toReturn; }
  • 12. Much idiomatic function doFizzBuzz (range) { var i = 0; for (i = 0; i < range; i++) { if (i % 3 === 0) { this.result += 'Fizz'; } if (i % 5 === 0) { this.result += 'Buzz'; } this.result += 'n'; } }
  • 13. Much high order function //interval stores the id of this interval var interval = window.setInterval(function () { if (this.isVisible === true) { document.getElementById('change').style.visibility = 'hidden'; this.isVisible = false; } else { document.getElementById('change').style.visibility = 'visible'; this.isVisible = true; } }, 500);