From 9aa751f390bb6f5061bb7182fd68b1ff270551e1 Mon Sep 17 00:00:00 2001 From: karthikaruna Date: Fri, 20 Nov 2020 16:02:07 +0530 Subject: [PATCH] Leverage String.prototype.repeat --- dom-api-question.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom-api-question.js b/dom-api-question.js index 7595cbb..e246db6 100644 --- a/dom-api-question.js +++ b/dom-api-question.js @@ -38,7 +38,7 @@ // Solution const INDENT_SIZE = 4; const getSpaces = (length) => { - return new Array(length).fill(" ").join(""); + return " ".repeat(length); }; class Node {