Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zombies.push(Zombie(_name, _dna)) — 1 #31

Open
veridelisi opened this issue Jan 25, 2022 · 1 comment
Open

zombies.push(Zombie(_name, _dna)) — 1 #31

veridelisi opened this issue Jan 25, 2022 · 1 comment

Comments

@veridelisi
Copy link

DON’T USE THIS
uint id = zombies.push(Zombie(_name, _dna)) — 1;
gives error in remix

USE THIS
zombies.push(Zombie(_name, _dna));
uint id = zombies.length - 1;

sincerely
Dr. Engin YILMAZ

@felixhalim
Copy link

Agree, .push() no longer have a return value in solidity version (0.8.14)

Reference: https://docs.soliditylang.org/en/v0.8.14/types.html?highlight=push#arrays

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants