+ 3
Why we write this.type .Please someone explain what is the use of this in this code.
2 Answers
+ 2
then we would use this in the same object in which we want to call
+ 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