Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

223
Views
About advanced javascript function

I'm beginner of javascript, I find some below code which cannot understand the work flow can any one help me inside:

(() => {
    var e = {
        900: (e, t, n) => {
            const r = n(300),
            o = n(700);
            e.exports = function (e) {
                const t = document.getElementById(e.target.dataset.id),
                x = document.getElementById(e.target.dataset.name),
                d = document.importNode(x, !0),
                o(e),
                s = r(d,{});
                t.appendChild(s.content)
            }
        },
        300: e => {
            e.exports = function (e, t) {
                return Object.keys(t).forEach((function (n) {
                        e.innerHTML = e.innerHTML.replace(new RegExp(`{{${n}}}`, "g"), t[n])
                    })),
                e
            }
        },
        500: e => {
            e.exports = function (e) {
                e.target.parentNode.parentNode.remove()
            }
        },
        700: e => {
            e.exports = function (e) {
                const t = document.getElementById(e.target.dataset.id),
                t.dataset.counter = parseInt(t.dataset.counter) + 1
            }
        }
    },
    t = {};
    function n(r) {
        if (t[r])
            return t[r].exports;
        var o = t[r] = {
            exports: {}
        };
        return e[r](o, o.exports, n),
        o.exports
    }
    (() => {
        const e = n(900),
        t = n(500);
        function r(n) {
            "add" === n.target.dataset.type ? e(n) : "remove" === n.target.dataset.type && t(n)
        }
        
    })()
})();

Base on above example, what's the mean of (()=> {}) and (() => {})() and why the end will add () , also what's the e.exports use for ? Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!