Consider the following files. math.js function add(a, b) { r…
Consider the following files. math.js function add(a, b) { return a + b; } function multiply(a, b) { return a * b; } module.exports = { add, multiply }; app.js const { multiply } = require(‘./math’); console.log(multiply(3, 4)); What will be printed when app.js runs?
Read DetailsConsider the following code. const http = require(‘http’); c…
Consider the following code. const http = require(‘http’); const server = http.createServer((req, res) => { if (req.method === “GET”) { res.end(“Fetching data”); } else if (req.method === “POST”) { res.end(“Sending data”); } else { res.end(“Other request”); } }); server.listen(3000); What will the browser display if a user submits a form using POST to http://localhost:3000?
Read Details