Title Text




                    function foo1()
                    {
                      return {
                          bar: "hello"
                      };
                    }
                    
                    function foo2()
                    {
                      return
                      {
                          bar: "hello"
                      };
                    }

What is the Output of foo1() and foo2() ?

foo1() return object and foo2() return undefined




    for (var i = 0; i < 5; i++) {
      setTimeout(function() { console.log(i); }, i * 1000 );
    }

What is the Output of above function ?

prints `5` 5 times

To update the state of component on Props change, which is the best place to update ?

ComponentWillReceiveProps.

Putting setstate on other place can cause extra renders




                  console.log(0.1 + 0.2);
                  console.log(0.1 + 0.2 == 0.3);

What is the Output two consoles ?

 0.300000000005,

false

Js Quiz

By Renganatha Arunachalam