const user = { "intro": { "name" : "Saud", "age" : 20, "qualification": "BS Computer" }, "address": { "country" : "Pakistan", "province" : "KP", "city" : "Mardan" }, userIntro(){ return `Name: ${this.intro.name}, age: ${this.intro.age}, qualification: ${this.intro.qualification}`; }, userAddress(){ return `country: ${this.address.country}, province: ${this.address.province}, city: ${this.address.city}` } } // let name = user.intro.name; // console.log(name); let userData = user.userIntro(); console.log(userData); let addressData = user.userAddress() console.log(addressData);