Minhaj Hussain

Minhaj Hussain

  • NA
  • 86
  • 6k

What is happening in the following javascript code:

Jan 18 2018 8:49 AM
var obj1 = {
Name: "ASLAM",
getName: function () {
return this.Name;
} }
var obj2 =
{
address : "PAKISTAN",
getAddress:function() {
return this.address;
} }
obj2 = obj1;
obj2.getName();
obj2.getAddress();
 
(What will be the output and what are the reasons behind it)

Answers (2)