Postgres Function Array Javascript Length Converter Calculator