You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I tried console.log(quantity)
I received the error message "TypeError: Cannot read properties of null (reading 'value')
at HTMLButtonElement. (amazon.js:75:46)"
The text was updated successfully, but these errors were encountered:
Hi Teslim, according to the error in your message, the problem appears to be on line 75. The correct code should be:
const quantity = Number(quantitySelector.value)
The difference here is, the value gotten from the quantity selector is converted to number from string. You can check this out.
P.S. I am still learning so I might be way off but I was able to check compare my code with yours and since I am a little bit ahead and thought to help.
When I tried console.log(quantity)
I received the error message "TypeError: Cannot read properties of null (reading 'value')
at HTMLButtonElement. (amazon.js:75:46)"
The text was updated successfully, but these errors were encountered: