Which one of you can give me an explanation of function a (xonomyje y) {console.log (x)} a (undefined,1)?

how to understand expressions that are related to the parameters of a function?

function a(x = y, y) {
    console.log(x); // y is not defined
}
function b(x, y = x){
    console.log(y);   // 1
}
a(undefined, 1)
b(1, undefined)
Sep.17,2021

x = y, ah, assignment,
y is not defined at this time, and the step of let y = 1 is also passing the parameter y
.

if you think correctly, the second one can understand

. The default value of the

parameter, and the default value is xnormalyline y, but there is no definition of

at this time.
Menu