DEV Community

Discussion on: Singleton in JavaScript

Collapse
 
kirankiran480 profile image
GUDLA VENKATA SANTHOSH KIRAN

how to destroy a created singleton instance

Collapse
 
tomekbuszewski profile image
Tomasz Buszewski

Hello Gudla,

You don't. Singleton, by design, is a single instance entity, so destroying it in one place would affect all the code that uses it. If you need destructible instances, don't use singletons.