Count Objects In Array Javascript Append Function In Python