+ 1

Can anyone explain this process.??

<script> function Car(color){ this.color = color || "red"; } var myCar = new Car (); console.log(myCar.color); </script>

2nd May 2019, 3:56 PM
KHUSHbu
KHUSHbu - avatar
2 Answers
+ 1
What exactly you do not understand from above code?
2nd May 2019, 4:05 PM
Sergiu Panaite
Sergiu Panaite - avatar
+ 1
It is to change your function to object and choose between the red and undefined in the console
2nd May 2019, 4:19 PM
Basel.Al_hajeri?.MBH()
Basel.Al_hajeri?.MBH() - avatar