I
I
ivandao2019-12-03 10:59:11
JavaScript
ivandao, 2019-12-03 10:59:11

How to move a method into a separate module?

There is a method like How to put it into a separate module and later attach it to the main file?
Array.prototype.replacer = function()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
2
2CHEVSKII, 2019-12-03
@2chevskii

And what, exactly, is the problem?
It's just that in order for the prototype extension to work, you need to call this module.
Wrap your code in a function, then call it with require(your file)( )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question