How to extend javascript function? (imported from other module)

Viewed 23

I've thought of this problem for days but I don't have an idea ...

There is a function named "loader" in "require.js" which helps reading js file.

The problem is, we need to redefine a function "loader" in another file "require-json.js". enter image description here

We need to 'extend' a function. It's already useful for reading JSfile but we need to add "LoadJSONFILE" function by refining it here.

I tried to write it follwed the algorithm above but loadjsfile is defined in "require.js" so I can't use it in "require-json.js".

How can I add a function which is imported? thanks.

0 Answers
Related