module

 JavaScript modules allow you to break up your code into separate files.

This makes it easier to maintain the code-base.

JavaScript modules rely on the import and export statements.


class M{
getData(){
    console.log("hello");
}    
}
export default M;
// module.exports=M;


import A from './M';
let ob=new A();
ob.getData();



export { }
export default function second() {
    return 4;
}



export { }
export default function second() {
    return 4;
}


import F from './first';
import D from './second';
console.log(D());

Comments

Popular posts from this blog

interview questions js[ Anurag Singh ProCodrr]

reactnative_creation