Skip to content
Advertisement

Adding strings returns empty string in Javascript

My goal is for this function to return only “03.12.21, 16:12:52”. Currently only “]” is returned.

JavaScript

Advertisement

Answer

Move let date = ""; outside of the loop (you are resetting it each iteration)

JavaScript
Advertisement