JS Parameter Syntax Question

Can someone please explain this to me?

let someFunc = (myObj=[]) => {

From what I can tell, if someFunc() is called without a parameter myObj gets set to an empty array for use within the function, otherwise the object that was passed is used instead. Is this correct, or is there something else going on? Also, is there a general name for this practice, I couldn’t find anything despite my best Googling…


you are correct
the term for this is “default parameter”

1 Like

Thank you very much!