This is found in popular npm repo, http2-proxy. The code runs like this:
async function proxy (
{ req, socket, res = socket, head, proxyName },
onReq,
onRes
) {...}
The object with the assign operator is pass to the function. I am just wondering if this syntax is correct, since an object should use a colon(:) as an assignment operator. I tested this syntax in the console, and sure enough gives a syntax error, but since it's found in a popular repo, I assumed this is correct, but how come?