Mujeeb Ahmed Profile picture
Mar 7 11 tweets 3 min read
JavaScript Objects 🔥🔥(Thread).
1. What is an Object in JavaScript?

The Object class represents one of JavaScript's data types. It's used to store keyed collections as well as more complex entities
2. How can you Create a JavaScript Object?

With JavaScript, you can define and create your objects.

There are different ways to create new objects:

1. Create a single object, using an object literal.

2. Create a single object, with the keyword new.
Using an Object Literal:

This is the easiest way to create a JavaScript Object.

Using an object literal, you both define and create an object in one statement.

An object literal is a list of name: value pairs (like name: "mujeeb") inside curly braces {}.

Example:
Using new keyword.
Example:
Using Object.create().
Example:
Accessing Properties of an Object.
The syntax for accessing the property of an object is: Syntax:Example.
Object Methods:
1. Keys.
2. values.
3. delete.
4. freeze.
1. keys:
The Object.keys() method produces an array of enumerable property names for a given object, iterated in the same way as a normal loop.

Example:
2. values:
The Object.values() method returns an array of enumerable property values for a given object in the same order as a for...in loop.

Example:
3. delete:
This method will remove the whole property from an array.

Example:
4. freeze:
An object is frozen using the Object.freeze() method. An object that has been frozen cannot be changed; Object.freeze() returns the same object that was passed in as an argument.

Example:

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Mujeeb Ahmed

Mujeeb Ahmed Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mujeeb0147

Mar 9
JavaScript Arrays🤩, Mega thread🚀.
All of the content includes examples so that any aspiring Web developer can quickly grasp the concepts. Image
1. What is a JavaScript Arrays.
An array in JavaScript is a variable that can hold several values.
Example: Image
2. What's the Point of Using an Array?
If you have a list of items (say, a list of car names), storing the cars in single variables might look like this:
Example: Image
Read 25 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(