Skip to content

lesson 6 - addPerson() - passing the arguments in hardhat #411

Discussion options

You must be logged in to vote

const updatedArray = await simpleStorage.addPerson();
Above line is what causing error, you are calling addPerson function but not giving any arguments.

What I understand is you are trying to get output after you passed the name and favNumber in "const transactionResponseAddPerson = await simpleStorage.addPerson("Nik", 10);" But most probably, your addPerson function does not have a return statement so how you can expect a return from it.

So, this is not the way you should do it. Either you need to call these variables people (array) or nameToFavoriteNumber (list) to get the output of the inputs you sent.

Replies: 1 comment 2 replies

Comment options

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

@jacobhay2626
Comment options

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