DEV Community

Nima Habibkhoda
Nima Habibkhoda

Posted on

3

Javascript fundamental [currying , ReFlow , Repaint (ReDraw)]

Alt Text

this article is a story about my experience that i earned in my last interview with a technical CTO . he taught me too much ,in that interview and i thanks him for the knowledge that he gifted to me .

this interview , made me to know much than before , about javascript fundamentals .

Re*(Flow && Paint) 

to understanding ReFlow and RePaint , this link helped me :

Understanding javascript Repaint and Redraw

If I want to say very clear :‌

ReFlow is recalculating positions of elements in document . reflow is a user-blocking operation , but it has some costs .

RePaint is affecting on element , not on layout .

ex : when you are hiding an element , adding or removing some classes , you dont change the layout , you changed the element visibility and repaint it to new one . 

Currying 

Currying is technique to call a function with multiple arguments like a recursively function . but it has some differences :

1- syntax 

2- it has sequence to run 

example :

var sum =   function (a){
                 return function(b){
                       return function(c){
                              return a+b+c;
                              }        
                        }
                  }
console.log(sum(5)(2)(5))  //12

currying is a collection of closures that are returned some value recursively depended of the sequence of theme . it is very nice , isn't it? i love it

i know this article has not much detailed , but i decide to share my experience with you and collect some of theme , in an archive placement . 

i will share more , in future

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more