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ICdNb2R1bGUnOwppbXBvcnQgbW9kdWxlMiBmcm9tICdNb2R1bGUnOwppbXBvcnQgbW9kdWxlMyBmcm9tICdNb2R1bGUnOwoKLy8g6re465+w642wIGNsYXNz66W8IGV4cG9ydCDtlZzqsoPsnbQg7JWE64uI6528IGluc3RhbmNl66W8IGV4cG9ydCDtlZzqsoPsnbTquLDripQg7ZWY7KeA66eMCi8vIGluc3RhbmNl66W8IO2Gte2VtCBjbGFzc+yXkCDsoJHqt7ztlaAg7IiYIOyeiOq4sCDrlYzrrLjsl5AgbW9kdWxlMeydhCDrp4zrk6TrlYwg7IKs7Jqp7ZaI642YIO2BtOuemOyKpOulvCDsnbTsmqntlbTshJwg65iQIOuLpOuluCDqsJ3ssrTrpbwg7LaU7ZuE7JeQIOunjOuTpOqzoOyekCDtlZzri6TrqbQg64uk7J2M6rO8IOqwmeydtCDrp4zrk6Qg7IiYIOyeiOyKteuLiOuLpApsZXQgYW5vdGhlciA9IG5ldyBtb2R1bGUxLmNvbnN0cnVjdG9yKCk7
//----------------------------------------------------------- // Module의 내용이 아래와 같다면 export default Math.random() > 0.5 ? {} : []; // 아래와 같이 import 했을때 다섯개는 모두 같은 인스턴스입니다 // 절반의 확률로 모두 {}이거나 []이고 (module1===module2 && module1===module3 && module1===module4 && module1===module5) === true 가 됩니다 import module1 from 'Module'; import module2 from 'Module'; import module3 from 'Module'; import module4 from 'Module'; import module5 from 'Module'; //----------------------------------------------------------- // 또.. Module의 내용이 아래와 같다면 class Person { }; export default new Person(); // 아래의 세개도 마찬가지로 동일한 인스턴스입니다 import module1 from 'Module'; import module2 from 'Module'; import module3 from 'Module'; // 그런데 class를 export 한것이 아니라 instance를 export 한것이기는 하지만 // instance를 통해 class에 접근할 수 있기 때문에 module1을 만들때 사용했던 클래스를 이용해서 또 다른 객체를 추후에 만들고자 한다면 다음과 같이 만들 수 있습니다 let another = new module1.constructor();