DEV Community

loading...

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

nimahkh profile image Nima Habibkhoda ・2 min read

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

Discussion (0)

pic
Editor guide