skip to Main Content

Javascript – Why doesn't it need undefined or null for optional parameters in Node.js?

See this example from Node.js docs: response.writeHead(statusCode[, statusMessage][, headers]) const body = 'hello world'; response .writeHead(200, { 'Content-Length': Buffer.byteLength(body), 'Content-Type': 'text/plain', }) .end(body); The second parameter of writeHead function should be statusMessage. Why can this second parameter be skipped automatically,…

VIEW QUESTION

Javascript – Npm package whatsapp-web.js broke

I have been working with whatsapp-wb.js for a while. Recently the package is not working anymore. Firstly, when I try their latest package i.e. "whatsapp-web.js": "^1.23.0", even before the qr code shows up, it throws: .../node_modules/whatsapp-web.js/src/webCache/LocalWebCache.js:34 const version = indexHtml.match(/manifest-([d\.]+).json/)[1];…

VIEW QUESTION
Back To Top
Search