Home
Current Affairs January 2024

What is the correct answer?

4

A JavaScript program developed on a Unix Machine ________

A. will throw errors and exceptions

B. must be restricted to a Unix Machine only

C. will work perfectly well on a Windows Machine

D. will be displayed as a JavaScript text on the browser

Correct Answer :

C. will work perfectly well on a Windows Machine


Explanation: JavaScript can be executed on different operating systems therefore the program developed on UNIX will work perfectly fine on windows also.

Related Questions

What is the correct answer?

4

What will be the output of the following Javascript code?
int a=0;
for(a;a<5;a++);
console.log(a);

A. 0

B. error

C. 4

D. 5

What is the correct answer?

4

What are the three important manipulations done in a for loop on a loop variable?

A. Updation, Incrementation, Initialization

B. Initialization,Testing, Updation

C. Testing, Updation, Testing

D. Initialization,Testing, Incrementation

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

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

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

What will be the output of the following JavaScript code?
var person =
{
name: Rahul,
getName: function()
{
nreturn this.name;
}
}
var unboundName = person.getName;
var boundName = unboundName.bind(person);
document.writeln(boundName());

A. runtime error;

B. compilation error

C. Rahul

D. undefined

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

What will be the output of the following JavaScript code?
function equalto()
{
int num=10;
if(num===10)
return true;
else
return false;
}

A. true

B. false

C. runtime error

D. compilation error

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 arr=[1,2,3];
var rev=arr.reverse();
document.writeln(rev);

A. 1, 2, 3

B. 3, 2, 1

C. 3

D. 1

What is the correct answer?

4

What will be the output of the following JavaScript code?
var pow=new Function(num1,num2,return Math.pow(num1,num2));
document.writeln(pow(2,3));

A. 2

B. 3

C. 8

D. error

What is the correct answer?

4

A hexadecimal literal begins with __________

A. 00

B. 0x

C. 0X

D. Both 0x and 0X

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

The function definitions in JavaScript begins with _____________

A. Identifier and Parentheses

B. Return type and Identifier

C. Return type, Function keyword, Identifier and Parentheses

D. Identifier and Return type

What is the correct answer?

4

One of the special feature of an interpreter in reference with the for loop is that ___________

A. Before each iteration, the interpreter evaluates the variable expression and assigns the name of the property

B. The iterations can be infinite when an interpreter is used

C. The body of the loop is executed only once

D. the iteration is finite when an interpreter is used

What is the correct answer?

4

The primary purpose of the array map() function is that it __________

A. maps the elements of another array into itself

B. passes each element of the array and returns the necessary mapped elements

C. passes each element of the array on which it is invoked to the function you specify, and returns an array containing the values returned by that function

D. pass the elements of the array into another array

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?
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 are the three important manipulations done in a for loop on a loop variable?

A. Updation, Incrementation, Initialization

B. Initialization,Testing, Updation

C. Testing, Updation, Testing

D. Initialization,Testing, Incrementation

What is the correct answer?

4

What will happen if reverse() and join() methods are used simultaneously?

A. Reverses and stores in the same array

B. Reverses and concatenates the elements of the array

C. Reverses

D. Stores the elements of an array in normal order

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

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

The basic purpose of the toLocaleString() is to _________

A. return a localised object representation

B. return a parsed string

C. return a local time in the string format

D. return a localized string representation of the object

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

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?
int a=1;
if(a!=null)
return 1;
else
return 0;

A. 1

B. 0

C. runtime error

D. compiler error

What is the correct answer?

4

Consider the following code snippet
function f(o)
{
if (o === undefined) debugger;
}

What could be the task of the statement debugger?

A. It does nothing but a simple breakpoint

B. It debugs the error in that statement and restarts the statements execution

C. It is used as a keyword that debugs the entire program at once

D. It is used to find error in the statement

What is the correct answer?

4

What will be the output of the following JavaScript code?
function printprops(o)
{
for(var p in o)
console.log(p + : + o[p] +
);
}

A. Prints the contents of each property of o

B. Returns undefined

C. Prints only one property

D. Prints the address of elements