DEV Community

Discussion on: Pure Functions in React

Collapse
 
ckanishka profile image
Kanishka Chowdhury

Nice and concise article.
But I had a doubt, please correct me if am wrong. Here you are trying to reassign a constant variable isn't that invalid?

const globalNumber = 4;

const multiply = (x) => {
  return globalNumber *= x 
}
Collapse
 
keevcodes profile image
Andrew McKeever

I've made the edit. Thanks for finding the typo