What's the difference? And why? #193
-
|
Both work the same. Is the first one just additional "typecasting" to make sure that the object created is of proper type? Of course as mentioned in the video, I am assuming that the array is of type "SimpleStorage". |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
You got it :) This first one "returns" a simpleStorageArray[_simpleStorageIndex]This next one says to cast whatever SimpleStorage(simpleStorageArray[_simpleStorageIndex])It's totally not necessary to do the |
Beta Was this translation helpful? Give feedback.
You got it :)
This first one "returns" a
SimpleStoragetype.This next one says to cast whatever
simpleStorageArray[_simpleStorageIndex]returns, to aSimpleStoragetype, so it's redundant.It's totally not necessary to do the
SimpleStorage(...)wrapping for this.