If a.js and b.js import each other, what will be the impact?

a.js

import B from "./b"
const b = new B()
console.log(b)

export default class A {
    testa = "aaa"
}

b.js

import A from "./a"
const a = new A()
console.log(a)

export default class B {
    testb = "bbb"
}
Mar.12,2022

Loop loading


Yes, it is not available to refer to each other, otherwise it will cause repeated references to report errors, so when developing, the structure should be clear


es6 will form a recursive

Menu