Skip to content

Lesson 1 Declaration error #520

Answered by cromewar
JacobG321 asked this question in Q&A
Dec 8, 2021 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hello @TwoDogsOneBigOneSmall
Solidity does not support default parameters, so setting up {favoriteNumber: 2, name: Patrick} is not valid. You should set those values at execution, not at declaration. However, there is a workaround if you want to set default values. you can refer to this thread.

Best regards, Cromewar.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@JacobG321
Comment options

@cromewar
Comment options

Answer selected by cromewar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants