From 2fd70c8ecaef7b5f545b50c881cd246e562edf0a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 25 Feb 2017 20:22:25 -0800 Subject: [PATCH] Ensure `toString` coerces nullish values in arrays to strings. --- toString.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toString.js b/toString.js index 7f8695c54..307e8da48 100644 --- a/toString.js +++ b/toString.js @@ -37,7 +37,7 @@ function toString(value) { } if (Array.isArray(value)) { // Recursively convert values (susceptible to call stack limits). - return `${ arrayMap(value, toString) }` + return `${ arrayMap(value, (other) => other == null ? other : toString(other)) }` } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''