From bc1b54f9c08bc489c3a402ac232797a1c6b64a39 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Mon, 1 Jan 2018 17:12:38 +0200 Subject: [PATCH] Update isArrayLike.md --- snippets/isArrayLike.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/snippets/isArrayLike.md b/snippets/isArrayLike.md index bd9a13e43..c281357bb 100644 --- a/snippets/isArrayLike.md +++ b/snippets/isArrayLike.md @@ -5,11 +5,7 @@ Checks if the provided argument is array-like (i.e. is iterable). Use the spread operator (`...`) to check if the provided argument is iterable inside a `try... catch` block and the comma operator (`,`) to return the appropriate value. ```js - - - - -const isArrayLike = val => +const isArrayLike = val => { try {return [...val], true; } catch (e) { return false; } };