The article is well written and it has a very good knowledge about how to refactor a code, but I would do this refactoring in a completely different way. If you have a static list of items (that is short enough as in the example), why don't you simple create a variable that will be the final resolve as you expect? Why using loops and so on while you could have a simple const newOutput = [ [ 'Angular' , 3 , '#d17a29' ], [ 'React' , 1 , '#da9554' ], [ 'Vue' , 2 , '#e3af7f' ], [ 'Next' , 1 , '#edcaa9' ], [ 'HTML' , 2 , '#f6e4d4' ], [ 'Other' , 3 , '#204e77' ] ];