I wrote a function that returns mapping type which contains all the tokenID and owner of the tokenID. But I get the following error when compiling.
error: TypeError: Data location must be "memory" or "calldata" for return parameter in function, but none was given.
Code:
mapping(uint256 => address) public tokenIdAndOwner;
function tokensAndOwner() public view returns (mapping(uint256 => address)){
//
return tokenIdAndOwner;
}
Is it possible to return mapping type in solidity? I am using solidity 0.8.7
Thank you