Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:49:53+00:00 2026-05-29T03:49:53+00:00

I read this a lot in many JavaScript introductions. I just don’t understand it.

  • 0

I read this a lot in many JavaScript introductions. I just don’t understand it. I always think of objects as something with methods and properties.
Arrays I understand, since it has key value pair.
How about “Strings” or “Numbers” or “functions” ?
These things above listed seem to be like functions to me. This means you input something, you get something out. You don’t really get the access properties or anything. There’s no dot notation used in arrays or this list of “objects”.

Does anyone code some examples of each of these with dot notations which its methods and properties are being accessed? I suspect that definition of object is probably limited since I did start learning about JavaScript…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:49:53+00:00Added an answer on May 29, 2026 at 3:49 am

    That’s right: in JavaScript, almost everything is an object. But these objects are bit different from what we see in Java, C++ or other conventional languages. An object in JS is simply a hashmap with key–value pairs. A key is always a string or a symbol, and a value can be anything including strings, integers, booleans, functions, other objects etc. So I can create a new object like this:

    var obj = {}; // This is not the only way to create an object in JS
    

    and add new key–value pairs into it:

    obj['message'] = 'Hello'; // You can always attach new properties to an object externally
    

    or

    obj.message = 'Hello';
    

    Similarly, if I want to add a new function to this object:

    obj['showMessage'] = function(){
      alert(this['message']);
    }
    

    or

    obj.showMessage = function() {
      alert(this.message);
    }
    

    Now, whenever I call this function, it will show a pop-up with a message:

    obj.showMessage();
    

    Arrays are simply those objects which are capable of containing lists of values:

    var arr = [32, 33, 34, 35]; // One way of creating arrays in JS
    

    Although you can always use any object to store values, but arrays allow you to store them without associating a key with each of them. So you can access an item using its index:

    alert(arr[1]); // This would show 33
    

    An array object, just like any other object in JS, has its properties, such as:

    alert(arr.length); // This would show 4
    

    For in-depth detail, I would highly recommend John Resig’s Pro JavaScript Techniques.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read a lot about this issue but mine still seems to be
I am working on this project where I need to read in a lot
I read this PHP RegEx page , but either I'm missing something, misreading something,
I just read a lot of stuff about MyISAM and InnoDB as I have
Ok, I have read a lot of posts and resources about this but I
I have read about DFS and BFS many times but I have this doubt
I've researched this many hours and tried a lot of different things to figure
I've read many large projects in OOP, and I notice that a lot of
I read this answer and its comments and I'm curious: Are there any reasons
I read this post last night, and I noticed it was from 2006. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.