Welcome to the Linux Foundation Forum!

7.3 module.exports question and answer clarification

A. module.exports = func
C. module.exports = {func}

Can someone point me to more detailed reading on why the answer is A and C is incorrect above: when a given a function named func, how can func be exposed such that when the file that func is in is loaded by another module, the result of the require statement is func?

Comments

  • Hi @sood , I think you are in the incorrect forum. This is the Linux Networking and Administration (LFS211) forum.

    Regards,
    Luis.

  • sood
    sood Posts: 3

    Thanks. I was looking for LFW211 not LFS211

Categories

Upcoming Training