JavaScript Quiz #12

December 17, 2013 in JavaScript

Assume that we have the following short JavaScript code:

    var number = 50;
    var obj = {
        number: 60,
        getNum: function () {
	    var number = 70;
	    return this.number;


Will this code succeed or fail? and if it succeeds, what is the output of the alerts?

Read the complete answer

Comments are closed.

Skip to toolbar