Home
Current Affairs January 2024

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

Correct Answer :

A. High level programming language


Explanation: JavaScript is a high-level programming language that is interpreted by another program at runtime rather than compiled by the computers processor. Scripting languages, which can be embedded within HTML, commonly are used to add functionality to a Web page, such as different menu styles or graphics displays or to serve dynamic ads..

Related Questions

What is the correct answer?

4

Which is a more efficient JavaScript code snippet?
Code 1 :
for(var num=10;num>=1;num--)
{
document.writeln(num);
}

Code 2 :
var num=10;
while(num>=1)
{
document.writeln(num);
num++;
}

A. Code 1

B. Code 2

C. Both Code 1 and Code 2

D. Cannot Compare

What is the correct answer?

4

What will be the output of the following JavaScript code?
Int a=1;
if(a>10)
{
document.write(10);
}
else
{
document.write(a);
}

A. 10

B. 0

C. 1

D. Undefined

What is the correct answer?

4

The generalised syntax for a real number representation is __________

A. [digits][.digits][(E|e)[(+|-)]digits]

B. [digits][+digits][(E|e)[(+|-)]digits]

C. [digits][(E|e)[(+|-)]digits]

D. [.digits][digits][(E|e)[(+|-)]digits]

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 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

What will be the output of the following JavaScript code?
function code(id,name)
{
this.id = id;
this.name = name;
}
function pcode(id,name)
{
code.call(this,id,name);
}
document.writeln(new pcode(101,vivek).id);

A. vivek

B. 101

C. Runtime error

D. Compilation error

What is the correct answer?

4

What will be the output of the following Javascript code?
<script>
document.getElementById("demo").innerHTML = typeof "John"
</script>


A. integer

B. number

C. string

D. error

What is the correct answer?

4

The snippet that has to be used to check if a is not equal to null is _________

A. if(a!=null)

B. if (!a)

C. if(a!null)

D. if(a!==null)

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

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

What will be the output of the following JavaScript code?
int sum=0;
var arr = [10,15,20,30];
arr.forEach(function myFunction(element)
{
sum= sum+element;
});
document.writeln(sum);

A. 70

B. 75

C. 10

D. error

What is the correct answer?

4

What is the purpose of a return statement in a function?

A. Returns the value and continues executing rest of the statements, if any

B. Returns the value and stops the program

C. Returns the value and stops executing the function

D. Stops executing the function and returns the value

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?
<script>
var x = 10;
x *= 5;
document.getElementById("demo").innerHTML = x;
</script>


A. 5

B. 10

C. 50

D. Error

What is the correct answer?

4

What will be the step of the interpreter in a jump statement when an exception is thrown?

A. The interpreter stops its work

B. The interpreter throws another exception

C. The interpreter jumps to the nearest enclosing exception handler

D. The interpreter throws an error

What is the correct answer?

4

Among the keywords below, which one is not a statement?

A. debugger

B. with

C. if

D. use strict

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. 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 txt1 = good;
var txt2 = day;
document.getElementById(demo).innerHTML = txt1 + txt2;

 

A. good day

B. goodday

C. error

D. undefined

What is the correct answer?

4

What will be the output of the following JavaScript code?
var grade='B';
var result;
switch(grade)
{
case 'A':
{
result+=10;
break;
}
case 'B':
{
result+= 9;
break;
}
case 'C':
{
result+= 8;
break;
}
default:
result+= 0;
}
document.write(result);

A. 10

B. 9

C. 8

D. 0

What is the correct answer?

4

What will be the output of the following JavaScript code?
var arr = [7, 5, 9, 1];
var value = Math.max.apply(null, arr);
document.writeln(value);

A. 7

B. 5

C. 1

D. 9

What is the correct answer?

4

What will be the possible output of the following JavaScript code?
var a = [1,2,3,4,5];
a.slice(0,3);

A. Returns [1,2,3]

B. Returns [4,5]

C. Returns [1,2,3,4]

D. Returns [1,2,3,4,5]

What is the correct answer?

4

What will be the output of the following JavaScript code?
function output(option)
{
return (option ? yes : no);
}
bool ans=true;
console.log(output(ans));

A. Yes

B. No

C. Runtime error

D. Compilation error

What is the correct answer?

4

What will be the output of the following JavaScript code?
var grade='B';
var result;
switch(grade)
{
case 'A':
{
result+=10;
break;
}
case 'B':
{
result+= 9;
break;
}
case 'C':
{
result+= 8;
break;
}
default:
result+= 0;
}
document.write(result);

A. 10

B. 9

C. 8

D. 0

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

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

Consider the following JavaScript statements.
var text = testing: 1, 2, 3; // Sample text
var pattern = /d+/g // Matches all instances of one or more digits

In order to check if the pattern matches with the string text, the statement is ____________

A. text==pattern

B. text.equals(pattern)

C. text.test(pattern)

D. pattern.test(text)

What is the correct answer?

4

What will be the output of the following JavaScript code?
const obj = {prop: 12};
Object.preventExtensions(obj);
console.log( Object.isExtensible(obj));

A. 12

B. false

C. true

D. error

What is the correct answer?

4

What will be the output of the following JavaScript code?
var obj=
{
length:20,
height:35,
}
if (breadth' in obj === false)
{
obj.breadth = 12;
}
console.log(obj.breadth);

A. 20

B. 12

C. undefined

D. error

What is the correct answer?

4

The var and function are __________

A. Keywords

B. Declaration statements

C. Data types

D. Prototypes