Executescript subtraction not working

Here is my code

 {
  "Command": "executeScript",
  "Target": "return Number (${i}) + 4",
   "Value": "i
  },
{
  "Command": "echo",
  "Target": "${i}",
  "Value": ""
},
{
  "Command": "executeScript",
  "Target": "return Number (${j}) + 1",
  "Value": "j"
},
{
  "Command": "echo",
  "Target": "${j}",
  "Value": ""
},
{
  "Command": "echo",
  "Target": "${totalcount}",
  "Value": ""
},
{
  "Command": "executeScript",
  "Target": "return Number (${totalcount}) - 1",
  "Value": "totalcount"
},
{
  "Command": "echo",
  "Target": "${totalcount}",
  "Value": ""
},

here is the result

  • [echo] 5

  • [echo] 2

  • [echo] 3,453

  • [echo] NaN

why is the subtraction not working? I have also tried using executeScipt_Sandbox and adding “;” at the end as shown in the documentation: executeScript, execute script, Arrays - Selenium IDE Commands Tutorial

Works for me:

{
  "Name": "sub",
  "CreationDate": "2020-2-2",
  "Commands": [
    {
      "Command": "store",
      "Target": "1",
      "Value": "i"
    },
    {
      "Command": "executeScript",
      "Target": "return Number (${i}) + 4",
      "Value": "i"
    },
    {
      "Command": "echo",
      "Target": "${i}",
      "Value": "green"
    },
    {
      "Command": "store",
      "Target": "${i}",
      "Value": "totalcount"
    },
    {
      "Command": "echo",
      "Target": "${totalcount}",
      "Value": "pink"
    },
    {
      "Command": "executeScript",
      "Target": "return Number (${totalcount}) - 1",
      "Value": "totalcount"
    },
    {
      "Command": "echo",
      "Target": "${totalcount}",
      "Value": ""
    }
  ]
}