Jump to content
McKay Development

Recommended Posts

Posted

The Error I am Getting is

var item = theirItems.market_name

                                  ^

Type:Error: Cannot read property 'market_name' of undefined

 

it is the The Trade Offer part of my Code the Code Is Below

 

That is to Process Their Items in the Trade Offer

for (var i in theirItems) {
            var item = theirItems[i].market_name
            if (stock[item]){
                currentstock = stock[item].instock;
                StockLimit = stock[item].stocklimit;

I ahve been Creating My OWn Code and not sure why the Error i got has Occurred

Posted

This can be solved by using i.market_name instead of theirItems[i].market_name. Because you are using a foreach-like syntax, each i will become the ACTUAL object in the array, rather than an iterating index.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...