Is there syntactic sugar for calling a function on each element of a list in JavaScript?

Let’s say I had the following code: let array = [1, 2, 3] array.forEach(x => someFunc(x)) In Java, I know the second line could be simpler using Streams (at least for static methods), like so: array.stream().map(ClassName::someFunc) … Essentially I’m asking is there an analog for the ClassName::someFunc part in JavaScript, instead of having to write… Read More Is there syntactic sugar for calling a function on each element of a list in JavaScript?

Write multiple setInterval() at once with the same second parameter

I’m making a clock UI that shows analog, digital, and date at the same time. I made a function for each case that requires setInterval(). I wanted to know if I could write them at once in case there were many. function getAnalog(){ return ‘something’; } function getDigital(){ return ‘something’; } function getDate(){ return ‘something’;… Read More Write multiple setInterval() at once with the same second parameter