125). What will be the output of the following JavaScript statement?
var grand_Total=eval("10*10+5");

[A]10*10+5
[B]105 as a string
[C]105 as an integer value
[D]Exception is thrown

Show Answer

126). Do functions in JavaScript necessarily return a value?
var grand_Total=eval("10*10+5");

[A]It is mandatory
[B]Not necessary
[C] Few functions return values by default
[D]some functions do not return any value

Show Answer

127). Will the following JavaScript code work?
var tensquared = (function(x) {return x*x;}(10));

[A] Yes, perfectly
[B]Error
[C]Exception will be thrown
[D]Memory leak

Show Answer

128). What will be the output of the following JavaScript code?
var string2Num=parseInt("123xyz");

[A]123
[B]123xyz
[C]Exception
[D]NaN

Show Answer

129). The one-liner code that concatenates all strings passed into a function is ____________
var string2Num=parseInt("123xyz");

[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); }

Show Answer

130). If you have a function f and an object o, you can define a method named m of o with ________
var string2Num=parseInt("123xyz");

[A]o.m=m.f;
[B]o.m=f;
[C] o=f.m;
[D] o=f;

Show Answer

131). What will be the equivalent statement of the following JavaScript statement?
var o = new Object();

[A]var o = Object();
[B]var o;
[C]var o= new Object;
[D]Object o=new Object();

Show Answer

132). What is the difference between the two lines in the following JavaScript code?
!!(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 check 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

Show Answer

133). What will be the state stored in d in the following JavaScript code?
var c = counter(), d = counter(); 
c.count()
d.count() 
c.reset() 
c.count() 
d.count()

[A]1
[B]0
[C]Null
[D]Undefined

Show Answer

134). What will be the last statement return in the following JavaScript code?
function constfuncs() 
{
    var funcs = [];
    for(var i = 0; i < 10; i++)
        funcs[i] = function() { return i; };
    return funcs;
}
var funcs = constfuncs();
funcs[5]()

[A]9
[B]0
[C]10
[D]12

Show Answer

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

[A]7
[B]5
[C]1
[D]9

Show Answer

136). What will be the output of the following JavaScript code?
var add=new Function("num1","num2","return num1+num2");  
document.writeln(add(2,5));

[A]2
[B]5
[C]Error
[D]7

Show Answer

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

Show Answer

138). What will be the output of the following JavaScript code?
var a=2.99;
var ans=floor(a)*floor(a)
console.log(ans);

[A]9
[B]8.31
[C]Error
[D]4

Show Answer

139). What will be the output of the following JavaScript code?
var a=225;
document.writeln(Math.sqrt(a));

[A]225
[B]15
[C]Error
[D]Undefined

Show Answer

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

[A]0.80
[B]0.88
[C]0.50
[D]0.78

Show Answer

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

[A]1.00
[B]1.01
[C]1.05
[D]1.10

Show Answer