Posts

Showing posts with the label export

Export Keyword In JAVA SCRIPT (role and use)

Image
Export Keyword use and role image by DIX TECH : what is use and role of export and import keyword if you are beginner in js then you are here don't worry it is very easy to you after time export keyword here basic means of this keyword just to ensure what is it if you want to learn deep then click here Use Of export Keyword This is the code which written in an Module.js file file name : module.js //code starts export const add = (x, y) => { return x + y; } //code ends Now index.js is the file where we want to add two numbers x and y This is a new file name index.js and here randomly we want to use that add function which we have previuosly defined in module.js file to use that function we have to use import keyword is work to import the add funtion from the given file file name:index.js // code starts import add from ./module.js; // now we can use the add() function in index.js wheather it is written in module.js na...

Pageviews