Answer the question
In order to leave comments, you need to log in
How to pass an object to a function?
Guys, hello everyone?
how to pass a parameter to this function
export const qtyInCart = state => {
const found = state.cart.added.find( p => p.id === id)
if (!found){
return 0
} else
return found.quantity
}
Answer the question
In order to leave comments, you need to log in
if it is an ES6 import, then only after the import can it be called
import { qtyInCart } from './qtyInCart.js'
qtyInCart(param)
var qtyInCart = require("./qtyInCart.js")(param)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question