From 22a3fa52624ce9db108607b1fec6b8281e6d2990 Mon Sep 17 00:00:00 2001 From: "Rico Sta. Cruz" Date: Tue, 7 Mar 2017 16:51:40 +0800 Subject: [PATCH] Update --- extras/js-lazy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/js-lazy.md b/extras/js-lazy.md index 7126d6fb4..08bfb8218 100644 --- a/extras/js-lazy.md +++ b/extras/js-lazy.md @@ -10,9 +10,9 @@ category: JavaScript | Number to string | `'' + num` | `num.toString()` | | Date to UNIX timestamp | `+new Date()` | `new Date().getTime()` | | Any to boolean | `!!value` | `Boolean(value)` | -| Check array contents | `if (~arr.indexOf(v))` | `if (arr.contains(v))` \* | +| Check array contents | `if (~arr.indexOf(v))` | `if (arr.includes(v))` | -> * = `.contains` is ES6-only, otherwise use `.indexOf(val) !== -1` +> `.includes` is ES6-only, otherwise use `.indexOf(val) !== -1` if you don't polyfill ## Examples