robertoschler
over 1 year ago  Karma: 50
Is using the bytes() function the proper way to check for empty data or field elements in Solidity?

I'm working through another Ethereum tutorial while I wait for Cryptozombies lesson 6. In it, the author uses "bytes().length != 0" to check for "empty" data elements as part of various parameter/field validation checks.

Is this the proper way to check for empty data or field elements in Solidity? Also, I'm having trouble finding a Solidity docs reference to the "bytes()" function, probably due to "byte" being such a frequently used word. Does anyone have a link to an explanation of this function?

solidity
ethereum
empty
null
robertoschler
over 1 year ago  Karma: 50
Is using the bytes() function the proper way to check for empty data or field elements in Solidity?

I'm working through another Ethereum tutorial while I wait for Cryptozombies lesson 6. In it, the author uses "bytes().length != 0" to check for "empty" data elements as part of various parameter/field validation checks.

Is this the proper way to check for empty data or field elements in Solidity? Also, I'm having trouble finding a Solidity docs reference to the "bytes()" function, probably due to "byte" being such a frequently used word. Does anyone have a link to an explanation of this function?

solidity
ethereum
empty
null

ONE ANSWER
Earn tokens by posting and answering questions about blockchain!
Karma to eth
YOUR ANSWER