Node JS MCQs - 8
Which of the following is NOT a built-in middleware function in Express.js? A) express.json() B) express.static() C) express.urlen...
Which of the following is NOT a built-in middleware function in Express.js? A) express.json() B) express.static() C) express.urlen...
What is the purpose of the req.query object in Express.js? A) To access request query parameters B) To access request headers C) T...
In Express.js, what is the purpose of the res.redirect() method? A) To send an HTTP response with JSON data B) To send an HTTP respon...
Which of the following modules is commonly used for authentication in Node.js web applications? A) express-session B) http C) fs ...
Which of the following modules is commonly used for routing in Node.js web applications? A) http B) fs C) express D) os ...
What is the purpose of the npm install command in Node.js? A) To initialize a new Node.js project B) To install dependencies for a No...
What is the purpose of the Buffer class in Node.js? A) To manipulate binary data B) To manage HTTP requests C) To handle file syst...
What is Node.js? A) A JavaScript runtime built on Chrome's V8 JavaScript engine B) A front-end framework for building user interf...
What is the output of the following code snippet? $x = 10; $y = 3; echo $x % $y; A) 3 B) 1 C) 0 D) 2 Answer: ...
What is the output of the following code snippet? $x = 5; echo ++$x * 2; A) 12 B) 14 C) 11 D) 10 An...
What is the purpose of the array_search() function in PHP? A) Searches for a value in an array and returns its key B) Searches for a ...
What is the purpose of the session_destroy() function in PHP? A) Starts a new session B) Destroys all session variables C) Removes...
What is the purpose of the glob() function in PHP? A) Converts a string to lowercase B) Searches for files matching a specified patte...
Which of the following PHP functions is used to determine whether a variable is empty? A) empty() B) isset() C) is_empty() D) n...
Which of the following PHP superglobals contains information about files uploaded to the server? A) $_FILES B) $_POST C) $_GET D) $_S...
What is the output of the following code snippet? $a = 5; $b = 10; echo ($a > $b) ? "Greater" : "Smaller"; ...
What is the result of the expression 10 % 3 in PHP? A) 3 B) 1 C) 0 D) 2 Answer: B) 1 Which of the following is u...
What does PHP stand for? A) Personal Home Page B) Preprocessed Hypertext Processor C) PHP: Hypertext Preprocessor D) Hypertext ...
The error message you're encountering suggests that Angular doesn't recognize the ngForOf directive in your component template. This typically...
To validate an email address using both PHP and JavaScript, you can use the following approach: 1. Using JavaScript for Frontend ...