0

I have a huge object that is defined as

var success;

Then I access this object properties as follows:

var title = success.categories.cms.results[0].title;
console.log(title);
var company1 = success.categories.cms.results[0].company[0];
console.log(company1);

and so on. I can tell that the way I access object properties is correct because I get back the correct values in the console. But I have no idea why I also receive 'undefined' value after the correct value.

Any help would be very appreciated.

2
  • Can you also attach the JSON you are trying to parse. Commented Oct 10, 2019 at 9:34
  • 2
    Don't look at those console undefined. Console.log returns undefined and which is get printed. You should not be bothered about that. Commented Oct 10, 2019 at 9:41

1 Answer 1

1

coz function console.log() returns undefined value

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.