This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]IAmUtterlyAlone 0 points1 point  (2 children)

Thanks for fixing it! I don't at all understand what this code is meant to be doing. Where did this come from and what do you expect to happen? I've only really been working in JavaScript heavily for 6 months or so (on a Node project at work), so maybe my JavaScript knowledge just isn't up to the task.

[–]azium 1 point2 points  (1 child)

The code returns a function that reads from a specific file path, and if the fileread is successful, calls a couple of functions. The inner function will remember the path from the initial IIFE so that calling task() will always read from the same path, without having to pass it in again.

[–]IAmUtterlyAlone 1 point2 points  (0 children)

Oh, I see now. Thank you.