Re-creating the Lodash Library - chunk.method - checking for parameter


in one step for creating the chunk method we should check if size is undefined and if so set size = 1.
In the solution it says:

chunk(array, size=1) {


–> so we did the checking and setting in case it is undefined directly in the first line.
Could anybody tell me why this line of code is working and has some links where I can reread the subject? Seems I missed that…

Thank you!