Professional Documents
Culture Documents
2nd Semester Exam Js 2021 Final
2nd Semester Exam Js 2021 Final
2. Prototype is:
a) Variable of the object
b) Object that describes the properties of the function
c) Is part of every variable in JavaScript
d) Is function in JavaScript
Single choice answer / Correct answer: b
1. console.log(1) ;
2. setTimeout(()=>{ console.log(2) });
3. Promise.resolve(() => {console.log(3)});
4. setTimeout(() => {console.log(4)}, 1);
5. console.log(5);
a) 1-2-3-4-5
b) 1-5-3-2-4
c) 2-4-3-1-5
d) 3-4-5-2-1
Single choice answer / Correct answer: b
a) x = 44.
b) x = 24.
c) NaN
d) undefined
a) Not a Name.
b) Not a Number.
c) Nothing.
d) Short of `NaNaNaNa Batman!`
a) Const fs = require(‘fs’);
b) Const fs = require(‘file-system’);
c) fs.open(fileURL);
d) require(fileURL);
a) let a = {}.
b) let a = {“hello”: “world”}.
c) let a = Object.create({}).
d) let a = Object.create({}, {“hello”:”world”}.
21. Within an exam question list, 3 marks is awarded for every correct
answer and (-1) for every wrong answer. If the student got 38 marks
after attempting all questions, find the number of questions answered
correctly assuming that the total questions were 70.
a) 43
b) 21
c) 27
d) 34
Single choice answer / Correct answer: c
22. Find all divisible numbers with 4 or 6 from 4 to 1000. What is the
sum of all those numbers?
a) 122328
b) 122382
c) 166846
d) 166834
Single choice answer / Correct answer: d
23. What should be added within the following source code part:
var express = require("express");
var app = express();
app.listen(3000, () => {
console.log("Server running on port 3000");
});
in order to configure a REST API request handler that returns array of
students containing Michel and Thomas?
a) app.get("endpoint”, return ["Michael","Thomas"]);
b) app.get("/url", (req, res, next) => { res.json(["Michael","Thomas"]); });
c) return ["Michael","Thomas"];
d) None of the above
24. Which SQL operator is used to filter the result set by the result of
aggregate function?
a) FILTER
b) CHECK
c) WHERE
d) HAVING
Single choice answer / Correct answer: d