31). 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

Show Answer

32). A function definition expression can be called as __________
var string1 = ”123”;
var intvalue = 123;
alert( string1 + intvalue );

[A]Function prototype
[B]Function literal
[C]Function calling
[D] Function declaration

Show Answer

33). The property of a primary expression is ____________
var string1 = ”123”;
var intvalue = 123;
alert( string1 + intvalue );

[A]stand-alone expressions
[B]basic expressions containing all necessary functions
[C]contains variable references alone
[D]contains only keywords

Show Answer

34). Consider the following JavaScript statements.In order to check if the pattern matches with the string “text”, the statement is ____________
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A]text==pattern
[B]text.equals(pattern)
[C]text.test(pattern)
[D]pattern.test(text)

Show Answer

35). The expression of calling (or executing) a function or method in JavaScript is called ________
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A]Primary expression
[B]Functional expression
[C]Invocation expression
[D]Property Access Expression

Show Answer

36). What kind of expression is “new Point(2,3)”?
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A] Primary Expression
[B] Object Creation Expression
[C]Invocation Expression
[D]Constructor Calling Expression

Show Answer

37). Which of the operator is used to test if a particular property exists or not?
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A]in
[B]exist
[C]within
[D]exists

Show Answer

38). Among the following, which one is a ternary operator?
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A]+
[B]:
[C]-
[D]?:

Show Answer

39). “An expression that can legally appear on the left side of an assignment expression.” is a well known explanation for variables, properties of objects, and elements of arrays. They are called ___________
var text = "testing: 1, 2, 3"; // Sample text
var pattern = /\d+/g // Matches all instances of one or more digits

[A]Properties
[B]Prototypes
[C]Lvalue
[D]Definition

Show Answer

40). What will be the equivalent output of the following JavaScript code snippet?
x = ~-y;
w = x = y = z;
q = a?b:c?d:e?f:g;

[A]x = ~(-y); w = (x = (y = z)); q = a?b:(c?d:(e?f:g));
[B]x = a?b:(c?d:(e?f:g)); q = ~(-y); w = (x = (y = z));
[C]x = (x = (y = z));w = ~(-y); q = a?b:(c?d:(e?f:g));
[D]x = ~(-y); w = (x = (y = z)); q = (c?d:(e?f:g));

Show Answer

41). 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

Show Answer

42). 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

Show Answer

43). What will be the output of the following JavaScript code?
function height()
{	
    var  height = 123.56;
    var type = (height>=190) ? "tall" : "short";
    return type;
}

[A]123.56
[B]190
[C]tall
[D]short

Show Answer

44). What will be the output of the following JavaScript code?
string  a = ”hi”;
string  b =”there”;
alert(a+b);

[A]hi
[B]there
[C]hithere
[D]undefined

Show Answer

45). What will be the output of the following JavaScript code?
function output(object)
{
	var place=object ? object.place : “Italy”;
	return “clean:”+ place;
}
console.log(output({place:India}));

[A]clean:India
[B]clean:Italy
[C]error
[D]undefined

Show Answer

46). What will be the output of the following JavaScript code?

[A]7.25
[B] -7.25
[C]7
[D]-7

Show Answer

47). What will be the output of the following JavaScript code?

[A]125
[B]25
[C]5
[D]Error

Show Answer

48). What will be the output of the following JavaScript code?

[A]1.01
[B]1.047
[C]1.00
[D]1.4

Show Answer