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

+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@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
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
Victor 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 FME
Safe Software
 

Recently uploaded (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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
 
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
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
+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...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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
 
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...
 
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
 
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...
 
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
 
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...
 
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
 

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);