SlideShare a Scribd company logo
1 of 33
JSON in 5 slices

    Hendrik Van Belleghem
       Vlaanderen.pm
JSON in 5 slices

    Hendrik Van Belleghem
       Vlaanderen.pm
What is JSON?
What is JSON?
What is JSON?
•   Obviously not Perl!
What is JSON?
•   Obviously not Perl!

•   Poor man’s (Javascript’s) data serialization
What is JSON?
•   Obviously not Perl!

•   Poor man’s (Javascript’s) data serialization

•   Complex data structures
What is JSON?
•   Obviously not Perl!

•   Poor man’s (Javascript’s) data serialization

•   Complex data structures

•   Can be eval’ed
What is JSON?
•   Obviously not Perl!

•   Poor man’s (Javascript’s) data serialization

•   Complex data structures

•   Can be eval’ed

•   Human readable
What is JSON?
•   Obviously not Perl!

•   Poor man’s (Javascript’s) data serialization

•   Complex data structures

•   Can be eval’ed

•   Human readable

•   Hotter than Megan Fox’ pants!
The Plot
The Plot
The Plot
var Plot = { "Location": "Crystal Lake", // Hash
          "Killers": [ "Mrs Voorhees", "Jason Voorhees", "Roy Burns" ], // Hash with array
           "Synopsis": "Guy with hockey mask kills people who visit Crystal Lake",
           "How To Kill": // Hash with hash ; Name contains spaces ;-)
            { "Mrs Voorhees": "Decapitate",
             "Jason Voorhees": [ "Machete", "Axe to the head", "Drowning", // Array
                          "Dragged underwater", "Melted by toxic waste", // within
                          "Stabbed with Mystical Dagger", "Ejected into space" // hash
                          ],
                 "Roy Burns": "Steel spikes"
            },
         "Lessons Learned": "Don't have sex when you visit Crystal Lake"
     }
The Twist
The Twist
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }

// No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees
document.write(Plot["How To Kill"]["Mrs Voorhees"]);
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }

// No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees
document.write(Plot["How To Kill"]["Mrs Voorhees"]);
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }

// No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees
document.write(Plot["How To Kill"]["Mrs Voorhees"]);

// Array within array..
// OMGWTFBBQ He's alive!!?! How do I kill Jason??
for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++)
{ document.write(Plot["How To Kill"]["Jason Voorhees"][i]); }
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }

// No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees
document.write(Plot["How To Kill"]["Mrs Voorhees"]);

// Array within array..
// OMGWTFBBQ He's alive!!?! How do I kill Jason??
for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++)
{ document.write(Plot["How To Kill"]["Jason Voorhees"][i]); }
The Twist
document.write(Plot.Location); // Standard naming
document.write(Plot.Synopsis); // Standard naming

// Iterate through array
for(i=0; i < Plot.Killers.length ; i++) // Who are the killers?
{ document.write(document.write(Plot.Killers[i]);); }

// No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees
document.write(Plot["How To Kill"]["Mrs Voorhees"]);

// Array within array..
// OMGWTFBBQ He's alive!!?! How do I kill Jason??
for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++)
{ document.write(Plot["How To Kill"]["Jason Voorhees"][i]); }

// And finally, what have we learned of this carnage?
document.write(Plot.["Lessons Learned"]);
The End!
The End!
The End!

•   Square brackets are for arrays
The End!

•   Square brackets are for arrays

    •   except when you’re using non-standard names
The End!

•   Square brackets are for arrays

    •   except when you’re using non-standard names

•   Curly braces are for hash-like structures
The End!

•   Square brackets are for arrays

    •   except when you’re using non-standard names

•   Curly braces are for hash-like structures

•   Use colons to separate names and values
The End!

•   Square brackets are for arrays

    •   except when you’re using non-standard names

•   Curly braces are for hash-like structures

•   Use colons to separate names and values

•   Separate elements with a comma
The End!

•   Square brackets are for arrays

    •   except when you’re using non-standard names

•   Curly braces are for hash-like structures

•   Use colons to separate names and values

•   Separate elements with a comma

•   Don't have sex when you visit Crystal Lake!

More Related Content

Viewers also liked

Ancillary Task 1 Poster 2
Ancillary Task 1 Poster 2Ancillary Task 1 Poster 2
Ancillary Task 1 Poster 2Jonathanlarham
 
Resident evil talking head Hamzaa
Resident evil talking head HamzaaResident evil talking head Hamzaa
Resident evil talking head Hamzaakinghamzaa
 
Teaser trailer analysis
Teaser trailer analysisTeaser trailer analysis
Teaser trailer analysisTom
 
Resident Evil case study
Resident Evil case studyResident Evil case study
Resident Evil case studysamridley97
 
resident evil information
resident evil informationresident evil information
resident evil informationNils Snelders
 
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...Joanna Robinson
 
Resident Evil 6 Digital Artbook
Resident Evil 6 Digital ArtbookResident Evil 6 Digital Artbook
Resident Evil 6 Digital Artbookfranzredflame
 

Viewers also liked (9)

Ancillary Task 1 Poster 2
Ancillary Task 1 Poster 2Ancillary Task 1 Poster 2
Ancillary Task 1 Poster 2
 
Resident evil talking head Hamzaa
Resident evil talking head HamzaaResident evil talking head Hamzaa
Resident evil talking head Hamzaa
 
Teaser trailer analysis
Teaser trailer analysisTeaser trailer analysis
Teaser trailer analysis
 
Resident Evil
Resident EvilResident Evil
Resident Evil
 
Resident Evil case study
Resident Evil case studyResident Evil case study
Resident Evil case study
 
resident evil information
resident evil informationresident evil information
resident evil information
 
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...
Co-creative meaning and Resident Evil Outbreak : Re-writing Representations i...
 
Friday the 13th
Friday the 13thFriday the 13th
Friday the 13th
 
Resident Evil 6 Digital Artbook
Resident Evil 6 Digital ArtbookResident Evil 6 Digital Artbook
Resident Evil 6 Digital Artbook
 

More from hendrikvb

Mojo – Simple REST Server
Mojo – Simple REST ServerMojo – Simple REST Server
Mojo – Simple REST Serverhendrikvb
 
China.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackChina.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackhendrikvb
 
Source Filters in Perl 2010
Source Filters in Perl 2010Source Filters in Perl 2010
Source Filters in Perl 2010hendrikvb
 
Scrabbling Code - Beatnik - YAPC::Eu::2003
Scrabbling Code - Beatnik - YAPC::Eu::2003Scrabbling Code - Beatnik - YAPC::Eu::2003
Scrabbling Code - Beatnik - YAPC::Eu::2003hendrikvb
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101hendrikvb
 

More from hendrikvb (6)

Mojo – Simple REST Server
Mojo – Simple REST ServerMojo – Simple REST Server
Mojo – Simple REST Server
 
China.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hackChina.z / Trojan.XorDDOS - Analysis of a hack
China.z / Trojan.XorDDOS - Analysis of a hack
 
Source Filters in Perl 2010
Source Filters in Perl 2010Source Filters in Perl 2010
Source Filters in Perl 2010
 
Scrabbling Code - Beatnik - YAPC::Eu::2003
Scrabbling Code - Beatnik - YAPC::Eu::2003Scrabbling Code - Beatnik - YAPC::Eu::2003
Scrabbling Code - Beatnik - YAPC::Eu::2003
 
Cleancode
CleancodeCleancode
Cleancode
 
Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101Web Apps in Perl - HTTP 101
Web Apps in Perl - HTTP 101
 

Recently uploaded

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 

Recently uploaded (20)

Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Json In 5 Slices.Key

  • 1. JSON in 5 slices Hendrik Van Belleghem Vlaanderen.pm
  • 2. JSON in 5 slices Hendrik Van Belleghem Vlaanderen.pm
  • 5. What is JSON? • Obviously not Perl!
  • 6. What is JSON? • Obviously not Perl! • Poor man’s (Javascript’s) data serialization
  • 7. What is JSON? • Obviously not Perl! • Poor man’s (Javascript’s) data serialization • Complex data structures
  • 8. What is JSON? • Obviously not Perl! • Poor man’s (Javascript’s) data serialization • Complex data structures • Can be eval’ed
  • 9. What is JSON? • Obviously not Perl! • Poor man’s (Javascript’s) data serialization • Complex data structures • Can be eval’ed • Human readable
  • 10. What is JSON? • Obviously not Perl! • Poor man’s (Javascript’s) data serialization • Complex data structures • Can be eval’ed • Human readable • Hotter than Megan Fox’ pants!
  • 11.
  • 14. The Plot var Plot = { "Location": "Crystal Lake", // Hash "Killers": [ "Mrs Voorhees", "Jason Voorhees", "Roy Burns" ], // Hash with array "Synopsis": "Guy with hockey mask kills people who visit Crystal Lake", "How To Kill": // Hash with hash ; Name contains spaces ;-) { "Mrs Voorhees": "Decapitate", "Jason Voorhees": [ "Machete", "Axe to the head", "Drowning", // Array "Dragged underwater", "Melted by toxic waste", // within "Stabbed with Mystical Dagger", "Ejected into space" // hash ], "Roy Burns": "Steel spikes" }, "Lessons Learned": "Don't have sex when you visit Crystal Lake" }
  • 17. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming
  • 18. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming
  • 19. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); }
  • 20. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); }
  • 21. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); } // No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees document.write(Plot["How To Kill"]["Mrs Voorhees"]);
  • 22. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); } // No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees document.write(Plot["How To Kill"]["Mrs Voorhees"]);
  • 23. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); } // No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees document.write(Plot["How To Kill"]["Mrs Voorhees"]); // Array within array.. // OMGWTFBBQ He's alive!!?! How do I kill Jason?? for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++) { document.write(Plot["How To Kill"]["Jason Voorhees"][i]); }
  • 24. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); } // No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees document.write(Plot["How To Kill"]["Mrs Voorhees"]); // Array within array.. // OMGWTFBBQ He's alive!!?! How do I kill Jason?? for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++) { document.write(Plot["How To Kill"]["Jason Voorhees"][i]); }
  • 25. The Twist document.write(Plot.Location); // Standard naming document.write(Plot.Synopsis); // Standard naming // Iterate through array for(i=0; i < Plot.Killers.length ; i++) // Who are the killers? { document.write(document.write(Plot.Killers[i]);); } // No standard naming possible, use [ “ “ ] to read how to kill Mrs Voorhees document.write(Plot["How To Kill"]["Mrs Voorhees"]); // Array within array.. // OMGWTFBBQ He's alive!!?! How do I kill Jason?? for(i=0; i < Plot["How To Kill"]["Jason Voorhees"].length ; i++) { document.write(Plot["How To Kill"]["Jason Voorhees"][i]); } // And finally, what have we learned of this carnage? document.write(Plot.["Lessons Learned"]);
  • 28. The End! • Square brackets are for arrays
  • 29. The End! • Square brackets are for arrays • except when you’re using non-standard names
  • 30. The End! • Square brackets are for arrays • except when you’re using non-standard names • Curly braces are for hash-like structures
  • 31. The End! • Square brackets are for arrays • except when you’re using non-standard names • Curly braces are for hash-like structures • Use colons to separate names and values
  • 32. The End! • Square brackets are for arrays • except when you’re using non-standard names • Curly braces are for hash-like structures • Use colons to separate names and values • Separate elements with a comma
  • 33. The End! • Square brackets are for arrays • except when you’re using non-standard names • Curly braces are for hash-like structures • Use colons to separate names and values • Separate elements with a comma • Don't have sex when you visit Crystal Lake!