Skip to content Skip to sidebar Skip to footer

Square Bracket Inside Function Definition

In the Node js Documentation, I have seen something like this, fs.readFile(path[, options], callback) What do those square brackets mean? I'm sorry if this is duplicate, but I wasn

Solution 1:

It means that the parameter is optional. Call like

fs.readFile('some/path', options, callback)

or

fs.readFile('some/path', callback)

Post a Comment for "Square Bracket Inside Function Definition"