Message from JavaScript discussions

October 2020

— No clue.


elements = [...querySelectorAll '.class']
handler = ->
c = elements.length
for e,index in elements
if e
if detectVisible e
startAnimation e
elements[index] = null

if not c
window.removeEvent.. 'scroll', handler

window.addEvent.. 'scroll', handler

— Pseudo-code from mobile

— Const elements = ["[data-value]"];

flags = Array(elements.length).fill true;
handler = ->
c = flags.length;
for(flag, index in flags) {
if(flag) {
e = elements[index];

Is this correct syntax, up to that point?

Message permanent page

— Take care of the syntax, that's just an idea

— Eh, it's unfathomable for me, I know just a few basics of the syntax.

— Create a named function, to be able to remove it from the window later

— Done, but still no idea how to remove the listener appropriately.

— Node.removeEventListener('scroll', handlerFunctionName);

— What is a good way to schedule multiple tasks in nodejs? To build something like Twitter Bot.

— Events.

— Unless I'm mistaken about what you want. You can make custom event batches to execute at times intervals, I guess.

Message permanent page