React – A JavaScript Library
React.js is a JavaScript library for building user interfaces. Developed by Facebook (now Meta) in 2013. It is component-based, declarative, and allows for efficient UI updates. Key Features of React Component-Based Architecture: UI is built using reusable components. Virtual DOM: Updates only the changed parts, making React fast. Unidirectional Data Flow: Props and state maintain a predictable data structure. JSX (JavaScript XML): A syntax extension that lets you write HTML inside JavaScript. Hooks: Allow functional components to have state and other features. Mutable vs Immutable Mutable (Changeable) Mutable data types can be changed after creation. Example: Objects & Arrays are mutable. let arr = [1, 2, 3]; arr.push(4); // Modifies the original array console.log(arr); // [1, 2, 3, 4] Immutable (Unchangeable) Immutable data cannot be changed directly. Instead, you create a new copy. Example: Strings & Numbers are immutable. let str = "Hello"; str[0] = "M"; // This won't change the string console.log(str); // "Hello" Example of immutable object handling (creating a new object instead of modifying the original): ...