DEV Community

Discussion on: What is the equivalent of a static variable in JS

Collapse
 
deciduously profile image
Ben Lovy

Classes in ES6+ are really just syntax sugar, so I don't think this actually answers your question in quite the right spirit, but it is a feature you can use :)

Thread Thread
 
raghavmisra profile image
Raghav Misra

I 100% agree with you Ben, but if a feature is there, might as well use it, right?

Thread Thread
 
ionline247 profile image
Matthew Bramer

with and eval are features too. You might be better off looking into how functional programming can solve the problem you're solutioneering.