中括号代表 参数可选
举例:
buf.write(string[, offset[, length]][, encoding])
例子中:
第一个参数string
没有中括号,意思是必须传的;
offset[, length]]
和 encoding
在中括号内,为可选参数,即offset, length, encoding可传可不传;
[, length]
外面是offset,意味着没有传offset的话,length也不能传
中括号代表 参数可选
举例:
buf.write(string[, offset[, length]][, encoding])
例子中:
第一个参数string
没有中括号,意思是必须传的;
offset[, length]]
和 encoding
在中括号内,为可选参数,即offset, length, encoding可传可不传;
[, length]
外面是offset,意味着没有传offset的话,length也不能传