How can I rewrite this code to foreach?
forEach is an array method, where are the arrays?Layla Wilcox
Cast an object to an array. Object.keys, Object.values and Object.entries to helpAnonymous
Not how. forEach processes the array and performs some function for each value. In your case, it is not required to process all keys, but only oneAnonymous
To place the code, please use CodePen or similar tool. Thanks you!