From 7d9a989ce466bf84a21eea661f8c4da431e4d43b Mon Sep 17 00:00:00 2001 From: Tilman Potthof Date: Fri, 4 Dec 2015 12:44:30 +0100 Subject: [PATCH] add missing example for typecheck-array (fixes #291) --- docs/typecheck-array.md | 3 +++ examples/typecheck-array.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/docs/typecheck-array.md b/docs/typecheck-array.md index 0dc1a1d7..b5032410 100644 --- a/docs/typecheck-array.md +++ b/docs/typecheck-array.md @@ -13,6 +13,9 @@ The following patterns are considered problems; // invalid Object.prototype.toString.call(someArray) === '[object Array]'; // error: You should use the angular.isArray method + // invalid + Array.isArray(someArray) // error: You should use the angular.isArray method + The following patterns are **not** considered problems; /*eslint angular/typecheck-array: 2*/ diff --git a/examples/typecheck-array.js b/examples/typecheck-array.js index 164034af..b364c843 100644 --- a/examples/typecheck-array.js +++ b/examples/typecheck-array.js @@ -3,3 +3,6 @@ angular.isArray(someArray); // example - valid: false, errorMessage: "You should use the angular.isArray method" Object.prototype.toString.call(someArray) === '[object Array]'; + +// example - valid: false, errorMessage: "You should use the angular.isArray method" +Array.isArray(someArray)