javascriptlesson4
javascriptlesson4
What is an Object?
o Objects allow you to group related data and functionality in a single structure.
Example:
You can access object properties using dot notation or bracket notation.
Example:
console.log(person['age']); // Outputs: 25
Example:
Example:
Example:
What is an Array?
o An array is a collection of ordered values. Arrays are used to store multiple values in a
single variable.
Example:
You can access array elements using their index (starting from 0).
Example:
Modifying Arrays:
Example:
Example: