#i have big problem with solo project in module 5,
7 messages · Page 1 of 1 (latest)
Can you put this in a Scrim and share the link?
here is the link
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.
thanks alot for this informatiion,i now understand a bit but i am still confused,how can i make this work?
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);