Home
Current Affairs January 2024

What is the correct answer?

4

Which attribute is used to specify that the script is executed when the page has finished parsing? (only for external scripts)

A. parse

B. a sync

C. defer

D. type

Correct Answer :

C. defer


Explanation: The defer attribute is a Boolean attribute. When present, it specifies that the script is executed when the page has finished parsing.

Related Questions

What is the correct answer?

4

What will be the output of the following JavaScript code?
int a=4;
int b=1;
int c=0;
If(a==b)
document.write(a);
else if(a==c)
document.write(a);
else
document.write(c);

A. 4

B. 1

C. Error

D. 0

What is the correct answer?

4

What will be the output of the following JavaScript code?
var values=[one,two,Three];
var ans=values.shift();
document.writeln(ans);

A. one

B. two

C. three

D. error

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

JavaScript Code can be called by using ____________

A. RMI

B. Triggering Event

C. Preprocessor

D. Function/Method

What is the correct answer?

4

What happens in the following javaScript code snippet?
var count = 0;
while (count < 10)
{
console.log(count);
count++;
}

A. The values of count are logged or stored in a particular location or storage

B. The value of count from 0 to 9 is displayed in the console

C. An error is displayed

D. An exception is thrown

What is the correct answer?

4

When does the function name become optional in JavaScript?

A. When the function is defined as a looping statement

B. When the function is defined as expressions

C. When the function is predefined

D. when the function is called

What is the correct answer?

4

What will happen if the body of a for/in loop deletes a property that has not yet been enumerated?

A. The property will be stored in a cache

B. The loop will not run

C. That property will not be enumerated

D. The property will be enumerated

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

In the following switch syntax, the expression is compared with the case labels using which of the following operator(s)?
switch(expression)
{
statements
}

A. ==

B. equals

C. equal

D. ===

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

Which keyword is used to define the function in javascript?

A. void

B. int

C. function

D. main

What is the correct answer?

4

Consider the following code snippet.
while (a != 0)
{
if (a == 1)
continue;
else
a++;
}

What will be the role of the continue keyword in the above code snippet?

A. The continue keyword restarts the loop

B. The continue keyword skips the next iteration

C. The continue keyword skips the rest of the statements in that iteration

D. The continue keyword breaks out of the loop

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

The web development environment (JavaScript) offers which standard construct for data validation of the input entered by the user.

A. Controlled loop constructs

B. Case checking constructs

C. Validation constructs

D. All of the mentioned

What is the correct answer?

4

In the following syntax, the data type within the square brackets must be ___________
book[datatype]=assignment_value;

A. An integer

B. A String

C. An object

D. Floating point

What is the correct answer?

4

Consider the following code snippet.
function printArray(a)
{
var len = a.length, i = 0;
if (len == 0)
console.log(Empty Array);
else
{
do
{
console.log(a[i]);
} while (++i < len);
}
}

What does the above code result?

A. Prints the numbers in the array in order

B. Prints the numbers in the array in the reverse order

C. Prints 0 to the length of the array

D. Prints Empty Array

What is the correct answer?

4

Consider the following code snippet :
var c = counter(), d = counter();
c.count()
d.count()
c.reset()
c.count()
d.count()

The state stored in d is :

A. 1

B. 0

C. Null

D. Undefined

What is the correct answer?

4

Consider the following code snippet :
var string2Num=parseInt(123xyz);

The result for the above code snippet would be :

A. 123

B. 123xyz

C. Exception

D. NaN

What is the correct answer?

4

In the following switch syntax, the expression is compared with the case labels using which of the following operator(s)?
switch(expression)
{
statements
}

A. ==

B. equals

C. equal

D. ===

What is the correct answer?

4

What will be the output of the following JavaScript code?
function info()
{
int a=1;
int b=2;
return a*b;
}
document.write(info());

A. 1

B. 2

C. 3

D. error

What is the correct answer?

4

What is a block statement in JavaScript?

A. conditional block

B. block that contains a single statement

C. both conditional block and a single statement

D. block that combines multiple statements into a single compound statement

What is the correct answer?

4

When an empty statement is encountered, a JavaScript interpreter __________

A. Ignores the statement

B. Prompts to complete the statement

C. Throws an error

D. Shows a warning

What is the correct answer?

4

A proper scripting language is a __________

A. High level programming language

B. Assembly level programming language

C. Machine level programming language

D. Low level programming language

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

Which of the operator is used to test if a particular property exists or not?

A. in

B. exist

C. within

D. exists

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

When an empty statement is encountered, a JavaScript interpreter __________

A. Ignores the statement

B. Prompts to complete the statement

C. Throws an error

D. Shows a warning

What is the correct answer?

4

What will be the output of the following JavaScript code?

A. 125

B. 25

C. 5

D. Error

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

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