+ 3

Why we write this.type .Please someone explain what is the use of this in this code.

https://code.sololearn.com/Wo9MAe4FF81X/?ref=app

16th Oct 2017, 12:43 PM
Arpan Kanwer
2 Answers
+ 2
then we would use this in the same object in which we want to call
16th Oct 2017, 12:50 PM
Arpan Kanwer
+ 2
this is dictionary type of an array. instead of using numbers to get data you can use index name; much readable then using myArray [x] in your code you assign function to name and call object.name but you can call object.speed or object.color
16th Oct 2017, 12:48 PM
Melih Melik Sonmez
Melih Melik Sonmez - avatar