I see a couple potential issues here -- but without some sample input data, it's just a guess...
Using the triple equal operator forces JS to compare both the value and datatype for equality. So if you expect the output should be true, then I suspect your incoming value is the string "true", not a boolean. If you use the more forgiving == operator, then you may get what you expect.
In the previous code you are trying to access the field payload.On which means your payload is an Object, not a number. So you cannot compare any object to a number and get a truthy value.