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

  • Home
  • SEARCH
  • 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 3344564
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:05:03+00:00 2026-05-18T01:05:03+00:00

In JavaScript / jQuery, if I alert some object, I get either [object] or

  • 0

In JavaScript / jQuery, if I alert some object, I get either [object] or [object Object]

Is there any way to know:

  1. what is the difference between these two objects

  2. what type of Object is this

  3. what all properties does this object contains and values of each property

?

  • 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-18T01:05:03+00:00Added an answer on May 18, 2026 at 1:05 am

    You can look up an object’s keys and values by either invoking JavaScript’s native for in loop:

    var obj = {
        foo:    'bar',
        base:   'ball'
    };
    
    for(var key in obj) {
        alert('key: ' + key + '\n' + 'value: ' + obj[key]);
    }
    

    or using jQuery’s .each() method:

    $.each(obj, function(key, element) {
        alert('key: ' + key + '\n' + 'value: ' + element);
    });
    

    With the exception of six primitive types, everything in ECMA-/JavaScript is an object. Arrays; functions; everything is an object. Even most of those primitives are actually also objects with a limited selection of methods. They are cast into objects under the hood, when required. To know the base class name, you may invoke the Object.prototype.toString method on an object, like this:

    alert(Object.prototype.toString.call([]));
    

    The above will output [object Array].

    There are several other class names, like [object Object], [object Function], [object Date], [object String], [object Number], [object Array], and [object Regex].

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

Sidebar

Related Questions

These ribbon in stackoverflow and uservoice.com looks nice. is there any javascript library/jquery plugin
I have some jQuery/JavaScript code that I want to run only when there is
I have some JavaScript/jQuery code that watches for the changed event on a checkbox:
The below HTML/CSS/Javascript (jQuery) code displays the #makes select box. Selecting an option displays
New to javascript/jquery and having a hard time with using this or $(this) to
I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP
I am using JavaScript and jQuery. My main file has My.js and Ajax. My.js
How do you detect which form input has focus using JavaScript or jQuery? From
I want to handle F1-F12 keys using JavaScript and jQuery. I am not sure
I'm looking for a good 10 minute introduction to Unobtrusive Javascript using JQuery. I'm

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.