Home
Current Affairs January 2024

What is the correct answer?

4

JavaScript Code can be called by using ____________

A. RMI

B. Triggering Event

C. Preprocessor

D. Function/Method

Correct Answer :

D. Function/Method


Explanation: JavaScript code can be called by making a function call to the element on which JavaScript has to be run. There are many other methods like onclick, onload and onsubmit etc.

Related Questions

What is the correct answer?

4

What will be the output of the following JavaScript code?
var val1=[1,2,3];
var val2=[6,7,8];
var result=val1.concat(val2);
document.writeln(result);

A. 1, 2, 3

B. Error

C. 1, 2, 3, 6, 7, 8

D. 123

What is the correct answer?

4

A function with no return value is called ___________

A. Procedures

B. Method

C. Static function

D. Dynamic function

What is the correct answer?

4

Which is an equivalent code to invoke a function m of class o that expects two arguments x and y?

A. o(x,y);

B. o.m(x) && o.m(y);

C. m(x,y);

D. o.m(x,y);

What is the correct answer?

4

The statement a===b refers to _________

A. Both a and b are equal in value, type and reference address

B. Both a and b are equal in value

C. Both a and b are equal in value and type

D. There is no such statement

What is the correct answer?

4

The method or operator used to identify the array is __________

A. isarrayType()

B. ==

C. ===

D. typeof

What is the correct answer?

4

A conditional expression is also called a _______________

A. Alternative to if-else

B. Immediate if

C. If-then-else statement

D. Switch statement

What is the correct answer?

4

Consider the following code snippet.
for(var p in o)
console.log(o[p]);

The above code is equivalent to which code?

A.

for (var i = 0;i < a.length;i++)
console.log(a[i]);

B.

for (int i = 0;i < a.length;i++)
console.log(a[i]);

C.

for (var i = 0;i <= a.length;i++)
console.log(a[i]);

D.

for (var i = 1;i < a.length;i++)
console.log(a[i]);

What is the correct answer?

4

What will be the output of the following JavaScript code?
function compare()
{
int num=2;
char b=2;
if(a==b)
return true;
else
return false;
}

A. true

B. false

C. runtime error

D. compilation error

What is the correct answer?

4

JavaScript is ideal to ________

A. make computations in HTML simpler

B. minimize storage requirements on the web server

C. increase the download time for the client

D. increase the loading time of the website

What is the correct answer?

4

The reduce and reduceRight methods follow a common operation called __________

A. filter and fold

B. inject and fold

C. finger and fold

D. fold

What is the correct answer?

4

What will be the output of the following JavaScript code?
var a1 = [,,,];
var a2 = new Array(3);
0 in a1
0 in a2

A. true false

B. false true

C. true true

D. false true

What is the correct answer?

4

The type of a variable that is volatile is _______________

A. Volatile variable

B. Mutable variable

C. Immutable variable

D. Dynamic variable

What is the correct answer?

4

The purpose of extensible attribute is to __________

A. make all of the own properties of that object non configurable

B. to configure and bring a writable property

C. lock down objects into a known state and prevent outside tampering

D. to include new properties into the object

What is the correct answer?

4

What will be the output of the following JavaScript code?
const obj1 =
{
property1: 21
}
const descriptor1 = Object.getOwnPropertyDescriptor(obj1, 'property1');
console.log(descriptor1.configurable);
console.log(descriptor1.enumerable);

A. true 21

B. true false

C. true true

D. false false

What is the correct answer?

4

The unordered collection of properties, each of which has a name and a value is called _________

A. String

B. Object

C. Serialized Object

D. Array

What is the correct answer?

4

What will be the output of the following JavaScript code?

A. 7.25

B. -7.25

C. 7

D. -7

What is the correct answer?

4

What will be the output of the following Javascript code?
var a=3.7;
var b=2;
a=ciel(a)
document.writeIn(a*b);

A. 6

B. 7.4

C. 7.5

D. 8

What is the correct answer?

4

What will be the output of the following JavaScript code?
var string1 = 123;
var intvalue = 123;
alert( string1 + intvalue );

A. 123246

B. 246

C. 123123

D. Exception

What is the correct answer?

4

What will be the output of the following Javascript code?
var a= 0;
var b = 0;
while (a < 3)
{
a++;
b += a;
console.log(b);
}

A. 135

B. 123

C. 013

D. 01

What is the correct answer?

4

The property of a primary expression is ____________

A. stand-alone expressions

B. basic expressions containing all necessary functions

C. contains variable references alone

D. contains only keywords

What is the correct answer?

4

The enumeration order becomes implementation dependent and non-interoperable if ___________

A. If the object inherits enumerable properties

B. The object does not have the properties present in the integer array indices

C. The delete keyword is never used

D. Object.defineProperty() is not used

What is the correct answer?

4

JavaScript can be written __________

A. directly into JS file and included into HTML

B. directly on the server page

C. directly into HTML pages

D. directly into the css file

What is the correct answer?

4

Which keyword is used to define the function in javascript?

A. void

B. int

C. function

D. main

What is the correct answer?

4

The one-liner code that concatenates all strings passed into a function is

A.

function concatenate()
{
return String.prototype.concat('', arguments);
}

B.

function concatenate()
{
return String.prototype.apply('', arguments);
}

C.

function concatenate()
{
return String.concat.apply('', arguments);
}

D.

function concatenate()
{
return String.prototype.concat.apply('', arguments);
}

What is the correct answer?

4

What is the difference between the two lines given below ?
!!(obj1 && obj2);
(obj1 && obj2);

A. Both the lines result in a boolean value True

B. Both the lines result in a boolean value False

C. Both the lines checks just for the existence of the object alone

D. The first line results in a real boolean value whereas the second line merely checks for the existence of the objects

What is the correct answer?

4

The object has three object attributes namely ________

A. Class, parameters, objects extensible flag

B. Prototype, class, objects parameters

C. Prototype, class, objects extensible flag

D. Native object, Classes and Interfaces and Objects extensible flag

What is the correct answer?

4

Consider the following code snippet :
var grand_Total=eval(10*10+5);

The output for the above statement would be :

A. 10*10+5

B. 105 as a string

C. 105 as an integer value

D. Exception is thrown

What is the correct answer?

4

The expression of calling (or executing) a function or method in JavaScript is called ________

A. Primary expression

B. Functional expression

C. Invocation expression

D. Property Access Expression

What is the correct answer?

4

What is the observation made in the following JavaScript code?
var count = [1,,3];

A. The omitted value takes undefined

B. This results in an error

C. This results in an exception

D. The omitted value takes an integer value

What is the correct answer?

4

What is the prototype represents in the following JavaScript code snippet?
function f() {};

A. Function f

B. A custom constructor

C. Prototype of a function

D. Not valid