SlideShare a Scribd company logo
JavaScript 101
André Odendaal
Background
Netscape Navigator
Designed by Brendon Eich in 1995
Built to replace Java for the web and be “easy to use”
Principles from Java (syntax), Self (prototypes) & Scheme (functional)
Rushed to market with good, bad & questionable design choices
Microsoft created Jscript, a compatible dialect to avoid trademark issues

ECMA
Standardized by ECMA (European Computer Manufacturers Association)
Called ECMAScript between Netscape & Microsoft
Latest version 5 includes “strict mode” for more thorough error checking
Basic Types
number
Only 64-bit floating point
No integers, longs, doubles, signed or unsigned to complicate matters
Associative Law does not hold for some values
(a + b) + c === a + (b + c)

string
0 or more 16-bit Unicode (UCS-2) characters. No character type

boolean
true & false
Objects
Object Literals
Dynamic (not based on pre-defined class) collection of properties
Property names must be a unique string within the object

Basic Operations – Get, Set & Delete
object.name | object[name]
object.name = value | object[name] = value
delete object.name | delete object[name]

Property
Named collection of attributes
ES5 added functionality to define properties and added Get, Set functions
Attributes: value, writable, configurable, enumerable, get, set
Demo – Objects
Object Types
Arrays
Special object with index as property names (not associative)
Has properties like: length, sort(), filter()

RegEx
Regular expression object
2 primary methods exec() returns a match and test() returns boolean

Functions
An object which can be invoked with parentheses ()
Demo – Objects
Revisited
Other Types
null
Nothing

undefined
Less than nothing
Functions
Composition
Made up of 4 parts: function, name (optional), parameters, set of statements
2 additional parameters: arguments object & this (invocation context)

Invocation
Method – this is the local object
Function – this is the global object
Apply – this is passed as a parameter
Constructor – this is the new object

Calling
Assigning less parameters will make them undefined
Demo – Invoking Functions
Inheritance with Prototypes
Prototype with functions
All functions have a property prototype as a base object
Use new keyword with function invocation to create new objects
Constructor functions should start with a capital letter

Inheritance
If object doesn’t have a property look in base object
Demo - Prototyping
Questions?

More Related Content

What's hot

Java 101 Intro to Java Programming - Exercises
Java 101   Intro to Java Programming - ExercisesJava 101   Intro to Java Programming - Exercises
Java 101 Intro to Java Programming - Exercises
agorolabs
 
Property based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rulesProperty based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rules
Debasish Ghosh
 
Namespace in C++ Programming Language
Namespace in C++ Programming LanguageNamespace in C++ Programming Language
Namespace in C++ Programming Language
Himanshu Choudhary
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
Ruslan Shevchenko
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scala
pramode_ce
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to Scala
Tim Underwood
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
Mohammad Hossein Rimaz
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
fanf42
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
mircodotta
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
AnsviaLab
 
Front end fundamentals session 1: javascript core
Front end fundamentals session 1: javascript coreFront end fundamentals session 1: javascript core
Front end fundamentals session 1: javascript core
Web Zhao
 
Functions & closures
Functions & closuresFunctions & closures
Functions & closures
Knoldus Inc.
 
Constructor and destructor in c++
Constructor and destructor in c++Constructor and destructor in c++
Constructor and destructor in c++
Learn By Watch
 
Create and analyse programs
Create and analyse programsCreate and analyse programs
Create and analyse programs
Dr. C.V. Suresh Babu
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design Patterns
Stefano Fago
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
Martin Odersky
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
Martin Odersky
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
Knoldus Inc.
 
Intro to functional programming
Intro to functional programmingIntro to functional programming
Intro to functional programming
Assaf Gannon
 

What's hot (19)

Java 101 Intro to Java Programming - Exercises
Java 101   Intro to Java Programming - ExercisesJava 101   Intro to Java Programming - Exercises
Java 101 Intro to Java Programming - Exercises
 
Property based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rulesProperty based Testing - generative data & executable domain rules
Property based Testing - generative data & executable domain rules
 
Namespace in C++ Programming Language
Namespace in C++ Programming LanguageNamespace in C++ Programming Language
Namespace in C++ Programming Language
 
Programming Languages: some news for the last N years
Programming Languages: some news for the last N yearsProgramming Languages: some news for the last N years
Programming Languages: some news for the last N years
 
Introduction to Functional Programming with Scala
Introduction to Functional Programming with ScalaIntroduction to Functional Programming with Scala
Introduction to Functional Programming with Scala
 
A Brief Intro to Scala
A Brief Intro to ScalaA Brief Intro to Scala
A Brief Intro to Scala
 
Quick introduction to scala
Quick introduction to scalaQuick introduction to scala
Quick introduction to scala
 
A Tour Of Scala
A Tour Of ScalaA Tour Of Scala
A Tour Of Scala
 
Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)Effective Scala (JavaDay Riga 2013)
Effective Scala (JavaDay Riga 2013)
 
Scala : language of the future
Scala : language of the futureScala : language of the future
Scala : language of the future
 
Front end fundamentals session 1: javascript core
Front end fundamentals session 1: javascript coreFront end fundamentals session 1: javascript core
Front end fundamentals session 1: javascript core
 
Functions & closures
Functions & closuresFunctions & closures
Functions & closures
 
Constructor and destructor in c++
Constructor and destructor in c++Constructor and destructor in c++
Constructor and destructor in c++
 
Create and analyse programs
Create and analyse programsCreate and analyse programs
Create and analyse programs
 
Uncommon Design Patterns
Uncommon Design PatternsUncommon Design Patterns
Uncommon Design Patterns
 
Simplicitly
SimplicitlySimplicitly
Simplicitly
 
Preparing for Scala 3
Preparing for Scala 3Preparing for Scala 3
Preparing for Scala 3
 
Xml processing in scala
Xml processing in scalaXml processing in scala
Xml processing in scala
 
Intro to functional programming
Intro to functional programmingIntro to functional programming
Intro to functional programming
 

Viewers also liked

EclipseCon 2011-Gemini Naming
EclipseCon 2011-Gemini NamingEclipseCon 2011-Gemini Naming
EclipseCon 2011-Gemini Naming
Shaun Smith
 
Anonymous functions in JavaScript
Anonymous functions in JavaScriptAnonymous functions in JavaScript
Anonymous functions in JavaScript
Mohammed Sazid Al Rashid
 
Sunum net weaver pi (fonksiyonel) tr
Sunum net weaver pi (fonksiyonel) trSunum net weaver pi (fonksiyonel) tr
Sunum net weaver pi (fonksiyonel) trFIT Solutions
 
Value Proposition for OBCs
Value Proposition for OBCsValue Proposition for OBCs
Value Proposition for OBCs
gangandlaniproductions
 
Java script
Java scriptJava script
Java script
Dhananjay Kumar
 
Bottled Water: Bad to the Last Drop
Bottled Water: Bad to the Last DropBottled Water: Bad to the Last Drop
Bottled Water: Bad to the Last Drop
michaeljm007
 

Viewers also liked (6)

EclipseCon 2011-Gemini Naming
EclipseCon 2011-Gemini NamingEclipseCon 2011-Gemini Naming
EclipseCon 2011-Gemini Naming
 
Anonymous functions in JavaScript
Anonymous functions in JavaScriptAnonymous functions in JavaScript
Anonymous functions in JavaScript
 
Sunum net weaver pi (fonksiyonel) tr
Sunum net weaver pi (fonksiyonel) trSunum net weaver pi (fonksiyonel) tr
Sunum net weaver pi (fonksiyonel) tr
 
Value Proposition for OBCs
Value Proposition for OBCsValue Proposition for OBCs
Value Proposition for OBCs
 
Java script
Java scriptJava script
Java script
 
Bottled Water: Bad to the Last Drop
Bottled Water: Bad to the Last DropBottled Water: Bad to the Last Drop
Bottled Water: Bad to the Last Drop
 

Similar to JavaScript fundamental data types and functions

Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
Allan Huang
 
Java scriptforjavadev part2a
Java scriptforjavadev part2aJava scriptforjavadev part2a
Java scriptforjavadev part2a
Makarand Bhatambarekar
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
Julie Lerman
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET World
ESUG
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
Hiroshi Ono
 
Oop java
Oop javaOop java
Oop java
Minal Maniar
 
Property Based Testing in PHP
Property Based Testing in PHPProperty Based Testing in PHP
Property Based Testing in PHP
vinaikopp
 
JavaScript in 2016
JavaScript in 2016JavaScript in 2016
JavaScript in 2016
Codemotion
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)
Eduard Tomàs
 
JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)
Piyush Katariya
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
Singsys Pte Ltd
 
DF15 - Dynamic Apex Binding with design patterns
DF15 - Dynamic Apex Binding with design patternsDF15 - Dynamic Apex Binding with design patterns
DF15 - Dynamic Apex Binding with design patterns
Fronde Systems Group
 
Functional Programming with JavaScript
Functional Programming with JavaScriptFunctional Programming with JavaScript
Functional Programming with JavaScript
Mark Shelton
 
Modern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscanaModern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscana
Matteo Baglini
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
Daniel Egan
 
Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6
Nilesh Jayanandana
 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1
mohamedsamyali
 

Similar to JavaScript fundamental data types and functions (20)

Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
 
Java scriptforjavadev part2a
Java scriptforjavadev part2aJava scriptforjavadev part2a
Java scriptforjavadev part2a
 
Entity Framework Today (May 2012)
Entity Framework Today (May 2012)Entity Framework Today (May 2012)
Entity Framework Today (May 2012)
 
Smalltalk in a .NET World
Smalltalk in a  .NET WorldSmalltalk in a  .NET World
Smalltalk in a .NET World
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
scalaliftoff2009.pdf
scalaliftoff2009.pdfscalaliftoff2009.pdf
scalaliftoff2009.pdf
 
Oop java
Oop javaOop java
Oop java
 
Property Based Testing in PHP
Property Based Testing in PHPProperty Based Testing in PHP
Property Based Testing in PHP
 
JavaScript in 2016
JavaScript in 2016JavaScript in 2016
JavaScript in 2016
 
JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)JavaScript in 2016 (Codemotion Rome)
JavaScript in 2016 (Codemotion Rome)
 
JavaScript (without DOM)
JavaScript (without DOM)JavaScript (without DOM)
JavaScript (without DOM)
 
Java Tutorial
Java TutorialJava Tutorial
Java Tutorial
 
DF15 - Dynamic Apex Binding with design patterns
DF15 - Dynamic Apex Binding with design patternsDF15 - Dynamic Apex Binding with design patterns
DF15 - Dynamic Apex Binding with design patterns
 
Functional Programming with JavaScript
Functional Programming with JavaScriptFunctional Programming with JavaScript
Functional Programming with JavaScript
 
Modern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscanaModern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscana
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6Introduction to Ecmascript - ES6
Introduction to Ecmascript - ES6
 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1
 

More from Andre Odendaal

Preparing Your CV
Preparing Your CVPreparing Your CV
Preparing Your CV
Andre Odendaal
 
Convolutional Neural Networks plays Racing Game
Convolutional Neural Networks plays Racing GameConvolutional Neural Networks plays Racing Game
Convolutional Neural Networks plays Racing Game
Andre Odendaal
 
State of game development
State of game developmentState of game development
State of game development
Andre Odendaal
 
Roguelike Theory
Roguelike TheoryRoguelike Theory
Roguelike Theory
Andre Odendaal
 
Prototyping with Text Adventures and MUDs
Prototyping with Text Adventures and MUDsPrototyping with Text Adventures and MUDs
Prototyping with Text Adventures and MUDs
Andre Odendaal
 
Create a worthwhile internship programme
Create a worthwhile internship programmeCreate a worthwhile internship programme
Create a worthwhile internship programme
Andre Odendaal
 
Machine Learning & Unity
Machine Learning & UnityMachine Learning & Unity
Machine Learning & Unity
Andre Odendaal
 
Narrative without fluff
Narrative without fluffNarrative without fluff
Narrative without fluff
Andre Odendaal
 
Comparing the scrum definition to its practice
Comparing the scrum definition to its practiceComparing the scrum definition to its practice
Comparing the scrum definition to its practice
Andre Odendaal
 
Overview of System Virtualization
Overview of System VirtualizationOverview of System Virtualization
Overview of System Virtualization
Andre Odendaal
 
Text adventures & muds
Text adventures & mudsText adventures & muds
Text adventures & muds
Andre Odendaal
 
Why you should make board games?
Why you should make board games?Why you should make board games?
Why you should make board games?
Andre Odendaal
 

More from Andre Odendaal (12)

Preparing Your CV
Preparing Your CVPreparing Your CV
Preparing Your CV
 
Convolutional Neural Networks plays Racing Game
Convolutional Neural Networks plays Racing GameConvolutional Neural Networks plays Racing Game
Convolutional Neural Networks plays Racing Game
 
State of game development
State of game developmentState of game development
State of game development
 
Roguelike Theory
Roguelike TheoryRoguelike Theory
Roguelike Theory
 
Prototyping with Text Adventures and MUDs
Prototyping with Text Adventures and MUDsPrototyping with Text Adventures and MUDs
Prototyping with Text Adventures and MUDs
 
Create a worthwhile internship programme
Create a worthwhile internship programmeCreate a worthwhile internship programme
Create a worthwhile internship programme
 
Machine Learning & Unity
Machine Learning & UnityMachine Learning & Unity
Machine Learning & Unity
 
Narrative without fluff
Narrative without fluffNarrative without fluff
Narrative without fluff
 
Comparing the scrum definition to its practice
Comparing the scrum definition to its practiceComparing the scrum definition to its practice
Comparing the scrum definition to its practice
 
Overview of System Virtualization
Overview of System VirtualizationOverview of System Virtualization
Overview of System Virtualization
 
Text adventures & muds
Text adventures & mudsText adventures & muds
Text adventures & muds
 
Why you should make board games?
Why you should make board games?Why you should make board games?
Why you should make board games?
 

Recently uploaded

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 

Recently uploaded (20)

GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 

JavaScript fundamental data types and functions

  • 2. Background Netscape Navigator Designed by Brendon Eich in 1995 Built to replace Java for the web and be “easy to use” Principles from Java (syntax), Self (prototypes) & Scheme (functional) Rushed to market with good, bad & questionable design choices Microsoft created Jscript, a compatible dialect to avoid trademark issues ECMA Standardized by ECMA (European Computer Manufacturers Association) Called ECMAScript between Netscape & Microsoft Latest version 5 includes “strict mode” for more thorough error checking
  • 3. Basic Types number Only 64-bit floating point No integers, longs, doubles, signed or unsigned to complicate matters Associative Law does not hold for some values (a + b) + c === a + (b + c) string 0 or more 16-bit Unicode (UCS-2) characters. No character type boolean true & false
  • 4. Objects Object Literals Dynamic (not based on pre-defined class) collection of properties Property names must be a unique string within the object Basic Operations – Get, Set & Delete object.name | object[name] object.name = value | object[name] = value delete object.name | delete object[name] Property Named collection of attributes ES5 added functionality to define properties and added Get, Set functions Attributes: value, writable, configurable, enumerable, get, set
  • 6. Object Types Arrays Special object with index as property names (not associative) Has properties like: length, sort(), filter() RegEx Regular expression object 2 primary methods exec() returns a match and test() returns boolean Functions An object which can be invoked with parentheses ()
  • 9. Functions Composition Made up of 4 parts: function, name (optional), parameters, set of statements 2 additional parameters: arguments object & this (invocation context) Invocation Method – this is the local object Function – this is the global object Apply – this is passed as a parameter Constructor – this is the new object Calling Assigning less parameters will make them undefined
  • 10. Demo – Invoking Functions
  • 11. Inheritance with Prototypes Prototype with functions All functions have a property prototype as a base object Use new keyword with function invocation to create new objects Constructor functions should start with a capital letter Inheritance If object doesn’t have a property look in base object

Editor's Notes

  1. Value defaults to undefinedWritable defaults to falseConfigurable defaults to falseEnumerable defaults to falseGet defaults to undefinedSet defaults to undefined
  2. Method: local objectFunction: global object // mistake, should be outer function this objectthat work-aroundConstructor: new objectApply: choose, list of parameters