javascript check if key value pair exists in object