Skip to content

Commit 0472c50

Browse files
committed
Add base radix for parseInt
While the second parameter is optional and usually defaults to 10 (base/radix is 10 for a decimal number), different implementations may behave differently. It also improves readability, if the base is given.
1 parent f8f80c6 commit 0472c50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

components/Cart/CartPage/MobileCartItem.component.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const MobileCartItem = ({
2929
return;
3030
}
3131
// If the user tries to delete the count of product, set that to 1 by default ( This will not allow him to reduce it less than zero )
32-
const newQty = event.target.value ? parseInt(event.target.value) : 1;
32+
const newQty = event.target.value ? parseInt(event.target.value, 10) : 1;
3333
// Set the new quantity in state.
3434
setProductCount(newQty);
3535
if (products.length) {

0 commit comments

Comments
 (0)