Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 25

[Q317-DL-4]

Consider the two codes given below:


What would the following bit of code produce?

<script type="text/javascript" language="javascript">

var a = "Starter";
var result = a.substring(2, 4);
document.write(result);

</script>

A. arte
B. tar
C. ar
D. tart

ANSWER: C

[Q318-DL-3]
Consider the two codes given below:
What will the following javascript code return:

var a=19;
var b=7;
var res=eval("a+b");
document.write(res);

A. 26
B. 197
C. a+b
D. none of the above
Answer: B

[Q319-DL-4]

Consider the two codes given below:

What will be the correct output of the code:

setTimeout(()=> console.log(3),2000);
console.log(1);
setTimeout(()=> console.log(2),0);
console.log(6);

A. 3 1 2 6
B. 1 3 2 6
C. 1 2 6 3
D. 1 6 2 3

Answer: D

[Q320-DL-3]

Consider the two codes given below:

What keyword is utilised to determine the validity of a given property in javascript?

A. exists
B. isinside
C. in
D. lies
Answer: C
[Q321-DL-5]

What will be the output of the function:

function make(arr, rotations){


if(rotations == 0) return arr;
for(let i = 0; i < rotations; i++){
let element = arr.pop();
arr.unshift(element);
}
return arr;
}

//make([99,1,4,555], 5);

A. [555,99,1,4]
B. [99,1,4,555]
C. [4,555,1,99]
D. [1,4,555,99]
Answer: A

[Q322-DL-4]

What will be the correct output of the code:

var a = Math.max();
var b = Math.min();
print(a);
print(b);

A. infinity -infinity
B. -infinity infinity
C. infinity infinity
D. -infinity -infinity

Answer: B
[Q323-DL-3]

Which JavaScript function is employed to serialize an object into a JSON string?

A. stringify()
B. convert()
C. parse()
D. none of the above

Answer: A

[Q324-DL-4]

What would the following bit of code produce?

a = [1, 2, 3, 4, 5];
print(a.slice(2, 4));

A. 2,3
B. 3,4
C. 3,4,5
D. 2,3,4
Answer: B

[Q325-DL-3]

What Javascript keyword is used to declare an asynchronous function?

A. await
B. async
C.setTimeout
D. none of the above
Answer: B
[Q326-DL-3]

... operator in javascript:

A. is used to spread elements that are iterable


B. is used to define an undefined datatype.
C. No such operator exists
D. None of the above.

Answer: A

[Q327-DL-5]

What will be the output of this code:

let q = [1, 2, 3, 4, 5, 6];


let l = 0, r = 5;
let present = false;
let ele = 5;
while(l <= r) {
let m = Math.floor((l+ r) / 2);
if(q[m] == ele) {
present = true;
break;
}
else if(q[m] < ele) {
l = m+ 1;
}
else {
r= m - 1;
}
}
if(present) {
print("YES");
}
else {
print("NO");
}
A. NO
B. YES
C. Syntax Error
D. None of the above
Answer: B

[Q328-DL-4]

const a = {Name: "alex", Age: 4};


const b = {Name: "alex", Age: 4};
print(a===b);

A. true
B. false
C. undefined
D. none of the above
Answer: B

[Q329-DL-4]

const yes= {a: 20, b: 30, a: 50};


console.log(yes);

A. {a: 20, b: 30, c: 50}


B. {a:20, b:30}
C. {a:50, b:30}
D. (b:30, A:50}
Answer: C

[Q330-DL-3]

Which of the following String object functions produces a number indicating whether
a reference string follows the supplied string in sort order, comes before it, or is the
same as it?

A. concat()
B. substr()
C. search()
D. localeCompare()

Answer: D

[Q331-DL-3]

Which of the subsequent array functions returns true if each member in the array
fulfils the testing function given?

A. every()
B.concat()
C. push()
D. some()
Answer: A

[Q332-DL-3]

The way to write HTML output using Javascript is:

A. Using innerHTMl()
B. using console.log()
C. using document.write()
D. using window.alert()
Answer: C

[Q333-DL-4]

What will be the output:

var x;
console.log(x);
x = 25;

A. 25
B. reference Error
C. Undefined
D. NAN
Answer: C

[Q334-DL-3]

Which event doesn't involve mice?

A.onmouseover
B.onmousemove
C.onclick
D.onmousescroller
Answer: D

[Q335-DL-3]

The ternary operator is which one?


A. <?
B. ?:
C. >=
D. <>
Answer: B

[Q336-DL-3]

Which technique is utilised to update the website?

A. window.reload()
B. location.reload()
C. window.refresh()
D. location.refresh()
Answer: B

[Q337-DL-3]

How to determine how many elements are included in an HTML form?


A. document.form.elements.count
B. document.form.count
C. document.form.length
D. document.form.elements.length
Answer: D

[Q338-DL-3]

What is onmouseover's opposite?

A. onmouseoff
B. onmouseunder
C. onmouseout
D. onnotmouseover
Answer: C

[Q339-DL-4]

What will the following code produce as a result?

const res = ['1', '1a', '0', -1, true, false].map(Number).filter(Boolean);


console.log(res);
A. [1,1]
B.[1,-1,1]
C.[1,NaN,-1,1]
D.[1,true]
Answer: B

[Q340-DL-4]
function compare()
{
int hey=1;
char j=1;
if(hey.tostring()===j)
return true;
else
return false;
}
a)runtime error
b) logical error
c) true
d) false
Answer: B

[Q341-DL-3]
What is the async attribute's default value?
a) 0
b) 1
c) True
d) False
Answer: C
[Q342-DL-3]
What steps are involved in creating a data frame?
a)frame(data)
b) frameData()
c) data.frame()
d) frame.Data()

Answer: C

[Q343-DL-3]

What does the localeCompare() method do?


a) if reference string should appear before or after another string if;
b) if it is validated;
c) if it is a reference string;
d)it is a reference string arrives first.

Answer: A

[Q344-DL-3]
Which of the following describes a script object attribute?
a)onclick
b) onload
c) onshow
d) onhover
Answer: B

[Q345-DL-3]
Which command is used to refresh the the webpage in javascript
a)window.reload
b) location.reload
c) window.refresh
d) page.refresh

Answer: B

[Q346-DL-3]

The message displayed in a dialogue box is displayed using which Window object method?
a) alert()
b) prompt()
c) message()
d) console.log
Answer: A

[Q347-DL-3]
To _______________, utilise the setTimeout() function.
A)Put the event to sleep
B) Register a function to be called after a specific amount of time
C) Call an event
D) Iteration time
Answer: B

[Q348-DL-3]
What criteria should I use to choose a document element based on the value of its id attribute?
a) getElementsbyId()
b) getElementbyId()
c) both getElementsbyId() and getElementbyId()
d) getElement

Answer: B

[Q349-DL-3]
What is the output of the code below:
var b5 = Boolean('false');
document.getElementById("demo").innerHTML =b5;
a)False
b) True
c) Error
d) Undefined
Answer: B

[Q350-DL-4]
What is the output of the following function:
function myFunction()
{
var x = null;
document.getElementById("demo").innerHTML = Boolean(x);
}
a)True
b) False
c) Error
d) Undefined

Answer: B

[Q351-DL-3]
How can Express.js construct chainable route handlers for a given route path?
a) Using app.route()
b) Using app.routes()
c) Using app.router()
d) Using app.routing()
Answer: A

[Q352-DL-3]

Which of the following is an Express.js middleware?


a) function(req){ }
b) method(req){ }
c) function(req,res,next){ }
d) method(req,res,next){ }
Answer: C
[Q353-DL-3]

Which of the following best describes how Express.js should be used with Node?
a) var = require('express')();
b) var_require('express')();
c) var app = require('express')();
d) None of the above.

Answer: C

[Q354-DL-3]

Which of the following methods asks that the server accept the information contained in the
request to change an already-existing object referenced by the URI?
a) GET
b) DELETE
c) PUT
d) POST

Answer: C

[Q355-DL-3]
Where are the captured values for the route parameters filled in?

a) app.locals object
b) req.data object
c) req.params object
d) None of the above.
Answer: C

[Q356-DL-3]

What command should you use to launch a REPL session?

a) $ node console
b) $ node repl
c) $ node start
d) $ node

Answer: A

[Q357-DL-3]

Which of the above methods is used to return the process's current working directory?
a) cwd();
b) cwd();
c) pwd();
d) None of the above.

Answer: A

[Q358-DL-3]
Which of the subsequent is not an authorised SQL type?
a) FLOAT
b) NUMERIC
c) DECIMAL
d) CHARACTER

Answer: C

[Q359-DL-3]

Which of the following doesn't constitute a legitimate aggregate function?


a) COUNT
b) COMPUTE
c) SUM
d) MAX

Answer: B

[Q360-DL-3]
What operator is employed when comparing a value to a given set of values?
a) ANY
b) BETWEEN
c) ALL
d) IN
Answer: D

[Q361-DL-3]
INSTR ('GOOD DAY', 'Y') returns what?
a) 6
b) 7
c) GOOD
d) DAY

Answer: B

[Q362-DL-3]

Of the following, which is also referred to as an INNER JOIN?


a) SELF JOIN
b) EQUI JOIN
c) NON-EQUI JOIN
d) None of the above
Answer: B

[Q363-DL-3]

Which statement regarding the HAVING clause is accurate?

a) Identical to the WHERE clause, but applied to columns as opposed to groups.


b) When used for rows rather than columns, it is comparable to the WHERE clause.
c) Identical to the WHERE clause but applied to groups as opposed to rows.
d) identical to a WHERE clause in behaviour.
Answer: C
[Q364-DL-3]

Which JOIN type is employed to return rows without matching values?


a) Natural JOIN
b) Outer JOIN
c) EQUI JOIN
d) All of the above
Answer: B

[Q365-DL-3]

What distinguishes a PRIMARY KEY from a UNIQUE KEY?

a) A unique key cannot store a null value, although a primary key can.
b) In contrast to many unique keys, a table can only have one primary key.
c) A date variable cannot be a primary key, however a unique key can
d) None of these

Answer: B

[Q366-DL-3]

What is the property that allows access to a node's first child?


a) timestamp.Child1
b) timestamp.Child(1)
c) timestamp.Child(0)
d) timestamp.firstChild
Answer: D
[Q367-DL-3]

What function do JavaScript event handlers serve?


a) Adds innerHTML page to the code
b) Performs handling of exceptions and occurrences
c) Allows JavaScript code to alter the behaviour of windows
d) Change the server location

Answer: C

[Q368-DL-3]
When the document's content in the window is stable and available for modification, which
handler is called?

a) onload
b) manipulate
c) create
d) onkeypress
Answer: B

[Q369-DL-3]

How can I discover every container element with the class "today" using JavaScript?
a)var elements = document.getElementsByClassName(“today”);
b) var elements = document.getElementByClassName(“today”);
c) var elements = document.getElementByName(“today”);
d) var elements = document.getElementsClassName(“today”);

Answer: A

[Q370-DL-3]

What function does the HTML DOM's "Attr" object serve?


a)Used to focus on a particular part of the HTML page
b) HTML Attribute
c) Used to arrange elements
d) CSS attribute

Answer: B

[Q371-DL-3]

What item is at the very top of the hierarchy?

a) Window Object
b) Document Object
c) Form Object
d) Form Control Elements

Answer: A
[Q372-DL-3]

JavaScript's typeof "null" is .

a)number
b) string
c) object
d) undefined
Answer: C

[Q373-DL-4]
We may use the _____________ method to transform a string to an array.

a) charAt()
b) charCodeAt()
c) split()
d) toLowerCase()

Answer: C

[Q374-DL-3]

The output of math.random() is

a)random number between 0 and 1


b) random number between 1 and 10
c) random number between 1 and 100
d) random number between 0 and 10
Answer: A

[Q375-DL-3]

Which of the following functions allows you to register a function that will be called repeatedly
after a given amount of time?
a)setTimeout()
b) setTotaltime()
c) setInterval()
d) settime()

Answer: C

[Q376-DL-3]

The location attribute belongs to what object?


a) Window
b) Position
c) Element
d) Location
Answer: A

[Q377-DL-3]
When Is The WHERE Clause Useful?
a) CREATE statement requires a perfect match.
b) SELECT statement requires an exact match.
c) SELECT query cannot find an exact match.
d) In a CREATE statement, it is impossible to find a perfect match.

Answer: C

[Q378-DL-3]

What would the following JavaScript code produce?


var string2Num=parseInt("789abc");

a) 789
b) 789abc
c) Exception
d) NaN

Answer: A

[Q379-DL-3]

Which method of the Window object may be used to open a new web browser window?
a) createtab()
b) Window.open()
c) open()
d) create()
Answer: B
[Q380-DL-3]

Which function is used to loop through all the values in an array?


a) all()
b) loop()
c) each()
d) every()
Answer: C

You might also like