JavaScript Object Reference
Full Stack Web Development Courses with Real-time projects Start Now!!
Program 1
class Test
{
constructor()
{
console.log("Constructor .......")
this.a=10
}
inrcrement()
{
++this.a
}
}
T1=new Test() // define
T2=T1 // Reference
T1.inrcrement()
T1.inrcrement()
console.log(T2.a)
// T1=new Test() // define object
// T2=new Test() //define object
// T1.inrcrement()
// T1.inrcrement()
// console.log(T2.a)
Did you know we work 24x7 to provide you best tutorials
Please encourage us - write a review on Google

