Answer the question
In order to leave comments, you need to log in
js function or variable?
Hi all.
which is preferable to a function or a variable, I am writing a react component, where the value should be displayed in the markup.
it can be evaluated as a function and called in markup
like
const getQuantity = () => {
return products.length
}
const quantity = products.length
Answer the question
In order to leave comments, you need to log in
Damn question... Sorry! Is the length property the same for products? If yes, then it is const
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question