Filter
Exclude
Time range
-
Near
JavaScript has eight fundamental data types, which can be categorized into primitive and non-primitive (reference) types.πŸŽ‰πŸš€ πŸ”ΉPrimitive Data Types (Immutable) 1. Number β†’ Represents numeric values (integers and floating-point numbers). let num = 42; let price = 99.99; --------------------------------------- 2. BigInt β†’ Used for very large integers beyond Number.MAX_SAFE_INTEGER let bigNum = 9007199254740991n; --------------------------------------- 3. String β†’ Represents text data let name = "John Doe"; --------------------------------------- 4. Boolean β†’ Represents true or false let isLoggedIn = true; --------------------------------------- 5. Undefined β†’ A variable that has been declared but not assigned a value. let x; console.log(x); // undefined --------------------------------------- 6. Null β†’ Represents an intentional absence of value. let emptyValue = null; --------------------------------------- 7. Symbol β†’ Represents a unique and immutable identifier (used for object properties). let sym = Symbol("unique"); --------------------------------------- πŸ”ΉNon-Primitive Data Type (Mutable, Reference Type) 8. Object β†’ A collection of key-value pairs (arrays, functions, and other objects fall under this). let person = { name: "Alice", age: 25 }; let arr = [1, 2, 3]; let func = function () { console.log("Hello"); }; --------------------------------------- Special Cases Arrays ([]) β†’ Special type of object for ordered lists. Functions (function) β†’ Objects with executable code. Date, RegExp, Map, Set, WeakMap, WeakSet β†’ Specialized objects. #JavaScript #LearnJavaScript #JavaScriptTutorial #JSDataTypes #JSBasics #WebDevelopment #CodingTips #FrontendDevelopment #react #FullStackDeveloper #coder #coding #react #ProgrammingForBeginners #CodeNewbie #100DaysOfCode #TechEducation #tips #SoftwareEngineering #CodingLife #javascript
31
7
39
1,498
Replying to @yr_gidyandrew
This Thread is Saved to your Notion Workspace. These tags were saved to the thread [Jsdatatypes]