JSX
Definition: JavaScript XML, syntax extension that allows writing HTML inside JS.
Variables (var, let, const)
Definition: Keywords to declare variables.
Explanation:
o var: function-scoped, can be re-declared, hoisted.
o let: block-scoped, cannot be re-declared in the same scope.
o const: block-scoped, value cannot be reassigned.
Hoisting
Definition: Hoisting is JavaScript’s default behavior of moving variable and function
declarations to the top of their scope.
Components -
Building blocks of React UI. Two types: Functional and Class Components.
Props
Definition: Short for properties, used to pass data from parent to child component.
State
Definition: State is an object that holds dynamic data in a component.
useEffect Hook
Definition: Hook to handle side-effects (API calls, subscriptions, DOM updates).
useRef Hook
Definition: Hook to directly access/manipulate DOM elements or persist values
across renders.
React Router
Definition: Library for navigation between components/pages.
Controlled vs Uncontrolled Components
Controlled: Input value controlled by React state.
Uncontrolled: Input value controlled by DOM itself (useRef).
Redux
Definition: State management library using single global store.
Key Concepts: Store, Action, Reducer, Dispatch.
Closure :-> A closure is a function that remembers the variables from its outer
scope, even after the outer function has finished executing.
function createCounter() {
let count = 0;
return function() {
count++;
return count;
}
}
const increment = createCounter();
console.log(increment()); // 1
console.log(increment()); // 2
console.log(increment()); // 3
Callback
Definition: A callback is a function passed as an argument to another function,
executed later.
Example:
function greet(name, callback){
console.log("Hello " + name);
callback();
}
greet("Jivan", ()=> console.log("Welcome!"));
Promise:-> A JavaScript object that represents the result of an operation that will finish in the
future. It will either succeed (resolve) or fail (reject).