I just heard about JavaScript objects and was wondering what they are (because I cannot find any information out there) and what they are useful for.
I really just need help with that. Sorry I am a beginner.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Apart from the few primitive types (numbers, strings, booleans, null and undefined) everything is an object in JavaScript (even functions).
Objects are basically containers of properties, which happen to be very useful for collecting and organizing data.
One popular method to create objects is to use the object literal notation:
The quotes around property names are optional if the name would be a legal JavaScript identifier and not a reserved word. A property’s name can be any string. Objects can contain other objects, so they can easily represent trees or graphs:
JavaScript objects also happen to be a convenient hash table data structure. You could easily do the following:
This is definitely not an exhaustive answer, but I hope it gets you going in the right direction when doing further research.