TypeScript
Array "forEach" vs. "includes"

by Benny Neugebauer

deletedPreKeyIds.forEach((id: number) => {
  this.cachedPreKeys = this.cachedPreKeys.filter((preKey: Proteus.keys.PreKey) => preKey.key_id !== id);
});

this.cachedPreKeys = this.cachedPreKeys.filter((preKey: Proteus.keys.PreKey) => !deletedPreKeyIds.includes(preKey.key_id));