Typescript Count Unique Values In Array Python Questions For If Statement