square bracket inside function definition

507 Views Asked by At

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't able to find an answer.

1

There are 1 best solutions below

3
On

It means that the parameter is optional. Call like

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

or

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