(1)
What will be the output of the following JavaScript statement?
var grand_Total=eval("10*10+5");
Answer: 105 as an integer value
var grand_Total=eval("10*10+5");
Answer: 105 as an integer value
Answer: Few functions return values by default
var tensquared = (function(x) {return x*x;}(10));
Answer: Yes, perfectly
var string2Num=parseInt("123xyz");
Answer: 123
Answer:function concatenate() { return String.prototype.concat.apply('', arguments); }
Answer: o.m=f;
var o = new Object();
Answer: var o= new Object;
!!(obj1 && obj2);
(obj1 && obj2);
Answer: The first line results in a real boolean value whereas the second line merely checks for the existence of the objects
var c = counter(), d = counter(); c.count() d.count() c.reset() c.count() d.count()
Answer: 1
function constfuncs() { var funcs = []; for(var i = 0; i < 10; i++) funcs[i] = function() { return i; }; return funcs; } var funcs = constfuncs(); funcs[5]()
Answer: 10
var arr = [7, 5, 9, 1]; var min = Math.min.apply(null, arr); document.writeln(min);
Answer: 1
var add=new Function("num1","num2","return num1+num2"); document.writeln(add(2,5));
Answer: 7
var a=3.7; var b=2; a=ciel(a) document.writeIn(a*b);
Answer: 8
var a=2.99; var ans=floor(a)*floor(a) console.log(ans);
Answer: 4
var a=225; document.writeln(Math.sqrt(a));
Answer: 15