cryptozombies-lesson-code
cryptozombies-lesson-code copied to clipboard
zombies.push(Zombie(_name, _dna)) — 1
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
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