function animal(name) { return typeof name;}
animal(null);
Thursday, 14 February 2013
Tuesday, 12 February 2013
JavaScript - Predict the Output - Question 3
"use strict";
var employee = {
name: 'Amnal'
};
Object.defineProperty(employee, 'age', {
value: 28,
});
for(var x in employee)
{
console.log(employee[x]);
}
"use strict";
var employee = {
name: 'Amnal'
};
Object.defineProperty(employee, 'age', {
value: 28,
});
for(var x in employee)
{
console.log(employee[x]);
}
Monday, 4 February 2013
JavaScript - Predict the Output - Question 2
Object.defineProperty(this, "MAX_SIZE", {
value: 100
});
alert("OLD VALUE "+ MAX_SIZE);
MAX_SIZE = 200;
alert("NEW VALUE "+MAX_SIZE);
What would be the output & why?
Tuesday, 29 January 2013
JavaScript - Predict the Output - Question 1
"use strict"; function strict() { "use strict"; // top of the function return { withStrict: function(){ return this; // undefined }(), withoutStrict: Function("return this")() }; } var really = strict(); really.withStrict;
You must specify the reason too.
Subscribe to:
Posts (Atom)