🚀 JavaScript Concepts Series – Day 1 👀 Let's Revise Basics 🧐 📌 JavaScript has two main categories of data types: 1️⃣ Primitive Data Types (Immutable): These store a single value and are not objects. • String • Number • Boolean • Undefined • Null • Symbol • BigInt Example: let name = "Deepak"; // String let age = 27; // Number let isDev = true; // Boolean 2️⃣ Non-Primitive (Reference) Data Types: These store collections of data or complex entities. • Object • Array • Function 👀 Example: let user_Object = { name: "Deepak", role: "Developer" }; let skills_Array = ["JavaScript", "React"]; function greet_Function() { console.log("Hello Developer"); } 💡 Key Insight: Primitive values are stored by value, while non-primitive values are stored by reference. #javascript #webdevelopment #frontenddeveloper #reactjs #coding
JavaScript Basics: Primitive & Non-Primitive Data Types
More Relevant Posts
-
Non-primitive data types Most JavaScript beginners learn numbers and strings first… But real power starts with non-primitive data types. 🚀 If you want to build real applications, you must understand these. In JavaScript, non-primitive data types can store multiple values and complex data. Here are the most important ones: • Object – Stores data in key–value pairs. Perfect for real-world data like users, products, or settings. • Array – Stores a list of values in a single variable. Great for lists like items, users, or tasks. • Function – A reusable block of code that performs a task. Functions are also treated as objects in JavaScript. • Date, Map, Set – Special objects used for managing time, unique values, and key-value collections. ✨ Key idea: Unlike primitive types, non-primitive types are stored by reference, which changes how copying and comparison work. Master these and your JavaScript skills will level up quickly. #JavaScript #WebDevelopment #FrontendDevelopment #ProgrammingBasics #LearnToCode #SoftwareDevelopment #JavaScriptTips #CodingForBeginners #FullStackDevelopment #TechEducation
To view or add a comment, sign in
-
-
Just published another blog This time on Variables and Data Types in JavaScript. While revisiting the fundamentals, I realized how important it is to clearly understand how variables work and the different data types in JavaScript. These basics shape how we write and think about code. In this blog, I’ve tried to break things down in a simple and easy-to-understand way. If you’re starting out with JavaScript or brushing up your fundamentals, feel free to check it out: https://lnkd.in/d7zxdGMZ Open to feedback and suggestions 🙂 #JavaScript #WebDevelopment #LearningInPublic #BuildInPublic #ChaiCode
To view or add a comment, sign in
-
Day 3 of My JavaScript Journey Today, I learned about JavaScript data types and how to define variables. JavaScript has two main types of data: Primitive data types: These include 7 types such as number, string, boolean, null, undefined, symbol, and bigint. Object: used to store more complex data. I also learned three ways to declare variables in JavaScript: • let • const • var One key thing I understood: "const" should be used by default, "let" when the value needs to change, and "var" is mostly outdated. Example: const name = "John"; let age = 20; Key takeaway: Understanding data types and variable declarations is fundamental to writing clean and predictable JavaScript code. #JavaScript #WebDevelopment #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 11/30 – Javascript interview series Local Storage vs Session Storage 🔥 Ever wondered where your browser stores data without a database? 🤔 Let’s break down Local Storage vs Session Storage in JavaScript 👇 💡 Local Storage ✔ Stores data with NO expiration time ✔ Data persists even after browser is closed ✔ Shared across tabs (same origin) 💡 Session Storage ✔ Stores data only for one session ✔ Data is cleared when the tab is closed ✔ Not shared between tabs ⚡ Syntax: 👉 localStorage.setItem("key", "value") 👉 sessionStorage.setItem("key", "value") 📌 Key Difference: Local Storage = Long-term storage 🗄️ Session Storage = Temporary storage ⏳ 🧠 Use Cases: ✔ Local Storage → Remember user preferences, themes ✔ Session Storage → Form data, temporary session info 🔥 Interview Questions: ❓ Difference between localStorage and sessionStorage? ❓ Storage limit? ❓ Is it secure to store sensitive data? (Hint: ❌ No) #javascript #webdevelopment #frontenddeveloper #reactjs #100daysofcode #interviewpreparation
To view or add a comment, sign in
-
Great insight Rushikesh Chavhan You can also add cookies and indexDB. IndexDB: Stores large structured data (MBs/GBs) Works like a NoSQL DB Used for: Offline apps Caching large data Complex data storage Cookies: Small pieces of data stored in the browse Used for: Authentication (session ID, tokens) Tracking / analytics
Front-End Developer @ Laminaar Aviation Infotech | 3 Years Experience | HTML | CSS | JavaScript | React.js | Nodejs | Web Developer | PG-DAC.
🚀 Day 11/30 – Javascript interview series Local Storage vs Session Storage 🔥 Ever wondered where your browser stores data without a database? 🤔 Let’s break down Local Storage vs Session Storage in JavaScript 👇 💡 Local Storage ✔ Stores data with NO expiration time ✔ Data persists even after browser is closed ✔ Shared across tabs (same origin) 💡 Session Storage ✔ Stores data only for one session ✔ Data is cleared when the tab is closed ✔ Not shared between tabs ⚡ Syntax: 👉 localStorage.setItem("key", "value") 👉 sessionStorage.setItem("key", "value") 📌 Key Difference: Local Storage = Long-term storage 🗄️ Session Storage = Temporary storage ⏳ 🧠 Use Cases: ✔ Local Storage → Remember user preferences, themes ✔ Session Storage → Form data, temporary session info 🔥 Interview Questions: ❓ Difference between localStorage and sessionStorage? ❓ Storage limit? ❓ Is it secure to store sensitive data? (Hint: ❌ No) #javascript #webdevelopment #frontenddeveloper #reactjs #100daysofcode #interviewpreparation
To view or add a comment, sign in
-
Have you ever needed to convert a JavaScript object to a string or vice versa? Understanding how JSON.parse and JSON.stringify work can make your data handling much smoother! ────────────────────────────── Mastering JSON.parse and JSON.stringify Unlock the full potential of JSON in your JavaScript projects with these key insights! #javascript #json #webdevelopment #codingtips ────────────────────────────── Key Rules • Use JSON.stringify to convert objects into a JSON string for storage or transmission. • Use JSON.parse to convert JSON strings back into JavaScript objects. • Be cautious of circular references; JSON.stringify will throw an error if you try to stringify an object with loops. 💡 Try This const obj = { name: 'Alice', age: 25 }; const jsonString = JSON.stringify(obj); const parsedObj = JSON.parse(jsonString); ❓ Quick Quiz Q: What will happen if you try to stringify an object with circular references? A: It will throw a TypeError. 🔑 Key Takeaway Mastering JSON.parse and JSON.stringify is essential for effective data management in JavaScript! ────────────────────────────── Small JavaScript bugs keep escaping to production and breaking critical user flows. Debugging inconsistent runtime behavior steals time from feature delivery.
To view or add a comment, sign in
-
Array methods are built-in functions that make it easier to add, remove, search, or transform data in an array, without writing complex loops. If you’re learning JavaScript basics, this might be useful: https://lnkd.in/gDy7in5h Feedback is welcome. Hitesh Choudhary Piyush Garg Anirudh Jwala
To view or add a comment, sign in
-
Have you ever found yourself struggling with data formats in JavaScript? JSON.parse and JSON.stringify are your best friends when it comes to converting data to and from JSON format. ────────────────────────────── Mastering JSON.parse and JSON.stringify Unlock the full potential of JSON in your JavaScript projects. #javascript #json #webdevelopment ────────────────────────────── Key Rules • Use JSON.stringify to convert JavaScript objects into JSON strings. • Use JSON.parse to turn JSON strings back into JavaScript objects. • Be mindful of data types; functions and undefined values cannot be stringified. 💡 Try This const obj = { name: 'Alice', age: 25 }; const jsonString = JSON.stringify(obj); const parsedObj = JSON.parse(jsonString); console.log(parsedObj); ❓ Quick Quiz Q: What does JSON.stringify do? A: It converts a JavaScript object into a JSON string. 🔑 Key Takeaway Mastering JSON methods can simplify data handling in your applications! ────────────────────────────── Small JavaScript bugs keep escaping to production and breaking critical user flows. Debugging inconsistent runtime behavior steals time from feature delivery.
To view or add a comment, sign in
-
🚀 JavaScript Day 2 – Deep Understanding of Core Concepts Today I focused on understanding each concept in detail with definitions and clarity 💻🔥 📌 Topics & Definitions: 🌐 Origin of JavaScript JavaScript was created in 1995 by Brendan Eich to make web pages interactive. 📝 Variables Declaration Variables are used to store data values using let, var, or const. 🔒 Constants Declaration Constants (const) store values that cannot be reassigned after declaration. ⚠️ Old Method: var var is the old way of declaring variables, function-scoped and can cause issues. ❌ Problems with var No block scope Can be redeclared Causes bugs due to hoisting 🔑 let vs const let → value can change const → value cannot change 📊 Data Types in JavaScript 👉 Primitive Data Types (Immutable) Number 🔢 → Stores numeric values String 🧵 → Stores text Boolean ✅❌ → true/false values Undefined ❓ → Variable declared but not assigned Null ⚪ → Intentional empty value BigInt 💡 → Large integers beyond Number limit Symbol 🔐 → Unique identifier 👉 Non-Primitive Data Types (Mutable) Array 📦 → Collection of values Object 🧱 → Key-value pairs Function ⚙️ → Reusable block of code 🧠 Important Concepts: 🔍 Null vs Undefined undefined → value not assigned null → intentionally empty ⚙️ typeof Operator Used to check data type of a value 🤯 typeof null Bug typeof null returns "object" (this is a known JavaScript bug) 🔒 Immutability (Primitive) Primitive values cannot be changed directly 🔄 Mutability (Non-Primitive) Objects & arrays can be modified 📥 Pass by Value Primitive values are copied when assigned 🔗 Pass by Reference Objects are assigned by reference (memory address) 💡 Why Pass by Reference? To save memory and improve performance 📅 Day 2 Complete ✔️ Building strong fundamentals step by step 💪 #JavaScript #LearningJourney #Day2 #Coding #WebDevelopment #Programming #Developer
To view or add a comment, sign in
-
-
𝗝𝗮𝗵𝗮𝗦𝗰𝗿𝗶𝗽𝘁: 𝗗𝗮𝗍𝗮 𝗧𝘆𝗽𝗲𝘀 𝗮𝗻𝗱 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 JavaScript is a programming language used for web development. It creates dynamic features for web pages and websites. JavaScript stores information in variables and follows rules to interact with a program. A JavaScript variable can hold 8 types of data: 7 primitive data types and 1 non-primitive data type. The primitive data types are: - Number: 12, 3.4 - String: text - Bigint: large integers - Boolean: true or false - Undefined: unknown value - Null: no value - Symbol: unique symbols The non-primitive data type is: - Object: stores multiple values, created with {} or the new keyword - Array: stores multiple elements under a single name, created with [] or the new keyword - Function: a block of code that can be assigned to a variable or passed as an argument You can declare JavaScript variables in 4 ways: - Automatically - Var: function scope - Let: block-level scoping, can reassign but not redeclare - Const: block-level scoping, cannot reassign or redeclare Source: https://lnkd.in/ggEx3tzy
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development