Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise

I am trying to figure out why object three won't access traits from object two when i use the document.write feature.

when I try to use this code on JS Bin "hello does not pop up on the screen like i would expect it to.

var two = {jack : 3,
          hello : "hello",
          bye : "bye"};
var three = inherit(two);
document.write(three.hello);

can someone explain what is wrong with this code.

share|improve this question

migrated from programmers.stackexchange.com Mar 20 at 17:29

This question came from our site for professional programmers interested in conceptual questions about software development.

1  
Where does your inherit function come from? You may want var three = Object.create( two) instead. – Zach Dennis Mar 20 at 1:49

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.