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 8695927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:09:29+00:00 2026-06-13T01:09:29+00:00

I have a basic understanding of instanceof in JavaScript, testing if the left hand

  • 0

I have a basic understanding of instanceof in JavaScript, testing if the left hand side object “is of” the right hand side object type. The following 2 examples help me understand that…

var demo1 = function() {};
demo1.prototype = {
foo: "hello"
};

var demo2 = function() {
var pub = {
    bar:"world"
};
return this.pub;
};

var obj1 = new demo1();
var obj2 = new demo2();

console.log(obj1 instanceof demo1);  //returns true
console.log(obj2 instanceof demo2);  //returns true

But on this 3rd example, I get false and I don’t understand why….

var o = {}; // new Object;
o.toString(); // [object Object]
console.log(o instanceof toString); //returns false

Thanks for any help in understanding whats going on. Also…is is possible to make the 3rd example true?

Thanks again

  • 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-06-13T01:09:31+00:00Added an answer on June 13, 2026 at 1:09 am

    o is an object; toString is a function. They are different types in JavaScript.

    alert(typeof(o));  //"object"
    alert(typeof(toString)); //"function"
    

    JavaScript makes a distinction between objects and functions. Therefore, that’s why you get false returned in your example.

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

Sidebar

Related Questions

I have some basic questions around understanding fundamentals of Performance testing. I know that
I think I have some basic understanding problem so maybe someone's able to help
I think I have a basic understanding of this, but am hoping that someone
I think I have a basic understanding of REST, but something I'm stuck on
I'm not a monad-jedi yet, but I have a basic understanding of them. Now
I think i have a basic problem in understanding the dojo toolkit. Well I
I have two basic interface-related concepts that I need to have a better understanding
I need some help understanding the Java memory model.The following is a gerneric example
I'm starting to dive into TFS 2012 and I have a basic understanding of
I'm fairly new to iOS programming, but have a basic understanding of it. 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.