#i have big problem with solo project in module 5,

7 messages · Page 1 of 1 (latest)

deft sparrow
#

if u need more code to help just tell me ,i am on this problem 2 days now.

valid heart
#

Can you put this in a Scrim and share the link?

deft sparrow
deft sparrow
valid heart
#

Ok... two problems:

line 18: you can't do === when comparing a number (menu.id) to a string (itemId) - itemId is coming from your html (data-plus="${item.id}")

That will ALWAYS be false and so itemFinder will always be undefined. Change the check to == instead of ===.

So now on line 20 you're trying to call .push on an undefined variable... this will error out.

Finally, even if you fix the problem above, you cannot "push" onto an Object... What you should be doing here is adding the item to an "order" of some kind - you don't seem to have that implemented though.

deft sparrow
#

thanks alot for this informatiion,i now understand a bit but i am still confused,how can i make this work?

valid heart
#

With your current code, comment out line 20 - this will never work. Then in line 21 just log itemFinder not [0]...

So new code:

20:    // itemFinder.push('hello'); 
21:    console.log(itemFinder);