JavaScript-Objects
JavaScript-Objects
upgrade your
knowledge!
Presentation by Ma’am Allie
Pick a Treasure
Chest!
A randomly chosen student will pick a
chest, each chest has different
challenges to overcome.
Pick a chest
…
Your question
chest is …
PARAMETERS What do
we call the
placeholde
rs in
JavaScript
Your question
chest is …
else if It is used to
STATEMENT
specify a
new
condition to
test, if the
Your question
chest is …
Write the
parts in a
syntax
formula in
a
Your question
chest is … This are
DEFAULT parameters
PARAMETERS to be
initialized
with default
values if no
Your question
chest is …
Write the
syntax
formula of
else
statement.
Your question
chest is …
JAVASCRIPT It is a
FUNCTIONS block of
code
designed
to perform
Your question
chest is …
CALLBACK A ___________ is
passed as an
FUNCTION argument to
another
function and is
executed after
Your question
chest is …
NESTED
This
function
FUNCTIONS have
access to
the
Congratul
ations on
winning
your
Finish my
story
Fill in the blanks in the story to unlock
different definition to finish the story.
Finish my story
OBJECT METHOD DOT KEY-VALUE PAIRS
COMMA (,) NOTATION
BALLPEN PROPERTIES
DYNAMIC WEBSITE
One day, Lou was exploring JavaScript when they encountered an unfamiliar
OBJECT PROPERTIES
concept: ______ (1). They learned that in JavaScript, an object is a collection of
_________ (2), which store information about an entity. Excited, she decided to
BALLPEN KEY-VALUE PAIRS
create their first object called ______ (3). To do this, they used curly braces ({ }) and
added __________ (4), which are pieces of information stored as key-value pairs.
COMMA
Suddenly, the console displayed an error! "Don't forget (,)
to separate each property
with a ______ (5)!" said their mentor. Fixing the mistake, they continued coding and
even added a METHOD
special function inside their object, called a ______ (6), allowing the
DOT
NOTATION
object to perform actions. Finally, she used ______ (7) to access their object's
DYNAMIC
properties and saw their program run successfully. From that day on, she WEBSITE
knew that
Bring me!
Race to bring the following items, then
describe what it is and what it is for.
Bring me!
objects
JavaScript
Objects
Prepared by Ma’am Allie
Lesson
Objectives
At the end of the lesson, the
students should be able to:
• discuss the purpose of JavaScript Objects in a
website;
• create different JavaScript Objects with properties
and values, and
• appreciate the usage of JavaScript objects in a
What is a JavaScript
The Object typeObject?
represents one of JavaScript's
data types. It stores data as key-value pairs,
where each key is a unique identifier for the
associated value.
Can an
Object be
a variable?
YES It is a common practice to declare
objects with the const keyword.
JavaScript Object
•
Definition
Using an Object Literal
• Using the new Keyword
• Using an Object
Constructor
JavaScript
Object Literal
An object literal is a list of name:value pairs inside curly
braces {}.
Note:
• name:value pairs are also called key:value pairs.
• object literals are also called object initializers.
Creating a
JavaScript Object
Spaces and line
breaks are not
important.
Agreement:
• You have 2 days to finish your output #2.
• Make sure your notes for lesson 1 has been checked, as well
as you should have already passed your output #1.
Thank you for
listening!