I defined a function in Solidity:
function store(uint256 _favoriteNumber) public {}
Then call the function with argument 7 in JavaScript:
contract.store(7);
But, according to the Patrick Collins JS video, it's better to wrap number 7 with quotes like this:
contract.sotre("7");
So here are two things confused me:
- Why it's better to wrap number with quotes when passing a number to a solidity contract function?
- Why ehter.js can automatically convert string to number?