How to print the value of variable using truffle console

pragma solidity ^0.5.1;
contract PRetVal {
   uint8  iVar =0;
   function testFunc() public returns (uint8) { 
      iVar = iVar + 10;
      return iVar;

I am trying the following :

truffle(development)> PR = await 
truffle(development)> await PR.getIVar 

Truffle has built-in ‘get” functions. But I am not getting any value. Somebody please guide me.


:computer: Environment


:1234: Code to reproduce

1 Like

I think you can have a try like this:

truffle(development)> await PR.getIVar()
1 Like