Mobilen First Approach using TailwindCSS and JavaScript

Solution retrospective
Hi everyone,
This is my solution to the calculator app challenge. I learned alot of things while doing it. Hope you enjoy it.
Quick question though, how do you guys include one javascript file into another file? for example you have first.js and second.js files and you want to include both in main.js file, whats the trick?
Please log in to post a comment
Log in with GitHubCommunity feedback
- @asbhogal
Hi Ibrahim,
Great work! In answer to your question, you export your functions and then import these as modules into another file (whether that's a second, or a main one.) This takes advantage of ES6, and conventionally you use a bundler to handle this, as vanilla environments can't handle module compilation without it. The easiest one to use in this case is Vite, which supports vanilla (pure HTML, CSS and JS) files, React, Angular etc. If you deploy these to Vercel, the platform will re-build your project with each Git commit. If you're new to these practices, I'd be happy to send you some links to documentation etc.
Hope this helps!
Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord