Posts by Evandro Lauro • 61 points
4 posts
-
0
votes1
answer36
viewsQ: Ways to directly test an internal function
Suppose we have the following closure function and would like to test the internal function with Jest. First-hand closure function made by me: function ModuleCharacterCounter() { function…
-
0
votes0
answers15
viewsQ: Is creating module using closure function a good practice?
It is known that closure is used to make variables within a function private and persistent. We assume I use closure to modulate smaller functions, would be considered good practice? If not, what…
-
1
votes1
answer76
viewsQ: Best practice of creating object from reduce
I wrote an algorithm using reduce which creates an object with two other objects inside, however I found unreadable. In search of inspiration to refactor the algorithm I ended up searching in…
-
4
votes2
answers94
viewsQ: Special characters are not displayed by the console.log
I’m solving a school exercise and I need to print a string with special characters using console.log, however the \ contained in the string are removed when executing the code. In search of the…