Add js function to count how often digit appears in range.