The length() method is only available on an array [].
In this case you are trying to get the size of a json object {}, please note this does not have a length. If you need to see how many items exist in this object, you can try to first convert all the keys into an array by using Object.keys(program)
which will give you an array.
If program
originally looked like this:
{
foo: 'some value',
bar: 'another value'
}
using Object.keys(program)
will give you ['foo', 'bar']
On this array you can now call the length method, so that you have Object.keys(program).length
, which in this case would give you 2.