Posts

technical

< script > // https://www.hellojavascript.info/docs/general-javascript-questions/javascript-fundamentals/arrow-functions // Redux is a global state management, it is used to read data from redux store and to read data we dispatch action to the store. // Redux is a pure function // redux is used when we want to deal with large projects, with large number of states. then we use redux. // Action -> Reducer -> Store // Reducer is a function which takes initial state and action and will return the updated state. // == operator is used to check the value. // === operator is used to check the value as well as the data type // Polymorphism means the same function with different signatures is called many times . In real life, for example, a boy at the same time may be a student, a class monitor, etc. So a boy can perform different operations at the same time. This is called polymorphism. // Different Kinds of Loops -- JavaScript supports different kinds of loops: // for - loops th...

Javascript Interview questions

  1) var vs let vs const A variable declared using ‘ var ’ can be redefined and even redeclared anywhere throughout its scope. var x = 30; console.log(x); //prints 30 x = "Hi"; //redefining or re-assigning (works without any error) console.log(x); //prints "Hi" var y = 10; console.log(y); //prints 10 var y = "Hello"; //Redeclaring (works without any error) console.log(y) //Prints "Hello"   A variable declared using ‘ let ’ can be redefined within its scope but cannot be re-declared within its scope. let x = 11; console.log(x); //prints 11 x = "IB"; //works without any error console.log(x); //prints "IB" let y = 12; console.log(y); //prints 12 let y = "Scaler"; // error: Identifier y has already been declared let z = 13; if(true){ let z = "Fun"; //works without any error as scope is different. console.log(z) //prints "Fun" } console.log(z) //prints 13     A variable declared using ‘...