Importing Javascript file into another Javascript file

PHOTO EMBED

Sun Oct 02 2022 07:06:35 GMT+0000 (UTC)

Saved by @Kristi #javascript

// main.js
 import { convertCurrency } from './obeserver.js';
//form the export default
 import someName from './obeserver.js';


//observer.js
const url = 'https://test.com';

export const convertCurrency = (EUR) => {
   return EUR * 0.9;
 };

export default url;
content_copyCOPY

https://www.youtube.com/watch?v=NSnckA3LyGw