From 4592b199e6d4a3ca022a20d4ae404c24332fb049 Mon Sep 17 00:00:00 2001 From: kajetansw <33182225+kajetansw@users.noreply.github.com> Date: Sat, 2 Mar 2019 17:57:05 +0100 Subject: [PATCH] fixed usage of array type (#24) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index fa0adac..f9e232d 100644 --- a/README.md +++ b/README.md @@ -317,7 +317,7 @@ This is by far the most important rule in software engineering. When functions d **Bad:** ```ts -function emailClients(clients: Client) { +function emailClients(clients: Client[]) { clients.forEach((client) => { const clientRecord = database.lookup(client); if (clientRecord.isActive()) { @@ -330,7 +330,7 @@ function emailClients(clients: Client) { **Good:** ```ts -function emailClients(clients: Client) { +function emailClients(clients: Client[]) { clients.filter(isActiveClient).forEach(email); }