Back to Basics: The 8 Building Blocks of JavaScript. 🧱 Sometimes we get so caught up in frameworks like React or Angular that we forget the fundamental DNA of the language. JavaScript data types are divided into two main categories: 𝐏𝐫𝐢𝐦𝐢𝐭𝐢𝐯𝐞𝐬 and 𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞𝐬. Knowing the difference is key to avoiding weird bugs (like accidental mutation). 1️⃣𝐓𝐡𝐞 𝟕 𝐏𝐫𝐢𝐦𝐢𝐭𝐢𝐯𝐞𝐬 (𝐈𝐦𝐦𝐮𝐭𝐚𝐛𝐥𝐞 & 𝐏𝐚𝐬𝐬-𝐛𝐲-𝐕𝐚𝐥𝐮𝐞) These are simple values. They don't have methods attached to them (until JS temporarily wraps them). • 𝐍𝐮𝐦𝐛𝐞𝐫: Integers & Floats. • 𝐒𝐭𝐫𝐢𝐧𝐠: Text. • 𝐁𝐨𝐨𝐥𝐞𝐚𝐧: True/False. • 𝐍𝐮𝐥𝐥: Intentionally empty. (The "I know this is empty" value). • 𝐔𝐧𝐝𝐞𝐟𝐢𝐧𝐞𝐝: Unintentionally empty. (The "I haven't set this yet" value). • 𝐒𝐲𝐦𝐛𝐨𝐥: Unique identifiers. • 𝐁𝐢𝐠𝐈𝐧𝐭: For numbers bigger than `2^53 - 1` (added in ES2020). 2️⃣𝐓𝐡𝐞 𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞 𝐓𝐲𝐩𝐞𝐬 (𝐌𝐮𝐭𝐚𝐛𝐥𝐞 & 𝐏𝐚𝐬𝐬-𝐛𝐲-𝐑𝐞𝐟𝐞𝐫𝐞𝐧𝐜𝐞) • 𝐎𝐛𝐣𝐞𝐜𝐭: The parent of them all. • 𝐅𝐮𝐧𝐜𝐭𝐢𝐨𝐧: Yes, functions are objects! They are "callable" objects. • 𝐀𝐫𝐫𝐚𝐲𝐬: Special objects with numeric keys. 💡 𝐂𝐥𝐚𝐬𝐬𝐢𝐜 𝐉𝐒 𝐈𝐧𝐭𝐞𝐫𝐯𝐢𝐞𝐰 𝐐𝐮𝐞𝐬𝐭𝐢𝐨𝐧: Why does `typeof null` return `'object'`? 𝐴𝑛𝑠𝑤𝑒𝑟: It’s actually a bug from the very first version of JavaScript! It can't be fixed now without breaking the web, so we live with it. 😅 Check out the full list in the infographic below! 👇 How often do you actually use `Symbol` or `BigInt` in your day-to-day work? #JavaScript #WebDevelopment #CodingBasics #SoftwareEngineering #Frontend #JSFundamentals
Nidhi Jagga’s Post
More Relevant Posts
-
Understanding Set in JavaScript Recently, I revisited Set in JavaScript, and it’s one of those small features that can greatly improve performance and code clarity. - What is a Set? A Set is a special JavaScript object that stores unique values only — duplicates are automatically removed. const mySet = new Set(); mySet.add(1); mySet.add(2); mySet.add(2); // duplicate ignored mySet.add(3); console.log(mySet); // Set(3) {1, 2, 3} - Ways to create a Set From scratch → new Set() From an array → perfect for removing duplicates const arr = [1, 2, 2, 3, 4, 4]; const uniqueValues = new Set(arr); - Useful Set Methods add() → Add value has() → Check if value exists (returns true/false) delete() → Remove value clear() → Remove all values size → Get total count const fruits = new Set(["apple", "banana", "mango"]); fruits.has("banana"); // true fruits.delete("banana"); console.log(fruits.size); // 2 - Why use Set? Stores unique values Easily removes duplicates Faster lookup performance Cleaner logic compared to arrays - Performance matters: Set.has() → O(1) Array.includes() → O(n) Small concepts like this can make a big difference when handling large datasets in real-world applications. - To know more, please visit w3schools.com and MDN 😊 #JavaScript #WebDevelopment #FrontendDevelopment #NodeJS #ReactJS #Programming #SoftwareDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
JavaScript developers everywhere can agree on one thing: Date has caused enough suffering. After 25+ years, we finally have a proper replacement: Temporal. Cleaner API, no weird mutations, and timezone handling that actually makes sense. This is a huge step forward for JavaScript. Great article explaining it: https://lnkd.in/dGUvGyxF #javascript #webdev #frontend
To view or add a comment, sign in
-
Stop fighting with new Date() in JavaScript! 🗓️ If you’ve ever spent hours debugging timezones or accidental date mutations, you know the native JS Date object is... well, tricky. The good news? The Temporal API is coming to fix it. 🚀 I just read a great breakdown via Wasp on why this is a game-changer. Here are the highlights: ✅ Immutable by default: No more accidental bugs when modifying dates. ✅ Built-in Timezone support: No more manual UTC conversions. ✅ Easy Arithmetic: Adding days or months is now a single method call away. Is it time to ditch date-fns and Moment.js? Check out the full breakdown here: https://lnkd.in/dfZC2qyb #JavaScript #WebDev #CodingTips #TemporalAPI #Frontend
To view or add a comment, sign in
-
🚀 New Blog Post Alert! Top 10 JavaScript Array Methods You Probably Haven't Used Yet Be honest — when was the last time you used copyWithin() or reduceRight()? 😅 I wrote a blog breaking down 10 underrated JavaScript array methods with real-world examples, including: ✅ with() — immutable single item replacement ✅ flatMap() — map + flatten in one step ✅ every() & some() — clean condition checks ✅ reduceRight() — reduce but from the right ...and 6 more! Perfect for developers who want to write cleaner, smarter JavaScript. 👉 Read it here: https://lnkd.in/dakkhzwd Drop your answer to the challenge inside the blog in the comments 👇 #JavaScript #WebDevelopment #100DaysOfCode #WebDevCohort2026 #Frontend #LearnToCode
To view or add a comment, sign in
-
Be honest — when was the last time you used copyWithin() or reduceRight()? 😅 We all use map(), filter(), and reduce() regularly… But JavaScript has several underrated array methods that can make your code cleaner, more expressive, and more efficient. In this blog, you’ll discover: ✅ with() — immutable single-item replacement ✅ flatMap() — map + flatten in one step ✅ every() & some() — cleaner condition checks ✅ reduceRight() — reduce, but from the right …and 6 more powerful methods you probably haven’t explored deeply. If you're serious about writing smarter JavaScript, this one’s worth your time. 🔗 Check it out below #JavaScript #WebDevelopment #Frontend #Programming #Developers
🚀 New Blog Post Alert! Top 10 JavaScript Array Methods You Probably Haven't Used Yet Be honest — when was the last time you used copyWithin() or reduceRight()? 😅 I wrote a blog breaking down 10 underrated JavaScript array methods with real-world examples, including: ✅ with() — immutable single item replacement ✅ flatMap() — map + flatten in one step ✅ every() & some() — clean condition checks ✅ reduceRight() — reduce but from the right ...and 6 more! Perfect for developers who want to write cleaner, smarter JavaScript. 👉 Read it here: https://lnkd.in/dakkhzwd Drop your answer to the challenge inside the blog in the comments 👇 #JavaScript #WebDevelopment #100DaysOfCode #WebDevCohort2026 #Frontend #LearnToCode
To view or add a comment, sign in
-
🚀 Day 2 — JSX: JavaScript + HTML At first glance, JSX looks like HTML 🤯 But in reality, it behaves like pure JavaScript. 👉 JSX stands for JavaScript XML It allows us to write UI structure and logic in one place. 💡 What many beginners don’t realize: JSX is not HTML and not understood by browsers directly. Behind the scenes 👇 JSX is converted into: JavaScript React.createElement() So when we write: JavaScript <h1>Hello World</h1> React actually processes it as: JavaScript React.createElement("h1", null, "Hello World") 🎯 Why JSX feels powerful Cleaner & more readable UI code JavaScript expressions inside { } UI updates automatically with data changes Encourages declarative programming 🧠 Developer mindset You’re not writing HTML You’re describing what the UI should look like ✨ JSX makes React components easier to read, maintain, and scale. #ReactJS #JSX #FrontendDevelopment #JavaScript #WebDevelopment #LearningInPublic #ReactTips #Day2
To view or add a comment, sign in
-
#coder #javascript 🧩 JavaScript Function — easy description A JavaScript function is a block of reusable code that performs a specific task. You write it once, and you can use (call) it many times whenever you need. 📌 Why we use functions ♻️ Reuse code (no repetition) 🧹 Keep code clean & organized 🧠 Make programs easier to understand 🔧 Fix or update logic in one place 🧱 Basic structure of a function function functionName() { // code to run } ▶️ Example function sayHello() { console.log("Hello, JavaScript!"); } sayHello(); // calling the function 🟢 Output: Hello, JavaScript! 📥 Function with parameters function add(a, b) { return a + b; } add(5, 3); // 8 a and b → parameters return → sends result back 🧠 Types of functions in JavaScript Normal Function Arrow Function const greet = () => { console.log("Hi!"); }; Function with return Anonymous Function
To view or add a comment, sign in
-
-
🚨 JavaScript #private fields in Production – Lessons Learned 🚨 JavaScript’s new #private class fields look great on paper… but introducing them into existing production code can cause serious issues if you’re not careful. Some real-world pitfalls I’ve seen 👇 🔹 Browser & runtime compatibility Older browsers / Node versions fail at parse time with: SyntaxError: Unexpected character '#' 🔹 Legacy code breaks instantly Any existing access like obj.prop or obj._prop will stop working. #private fields are truly inaccessible outside the class. 🔹 Inheritance surprises Private fields are NOT inherited. Subclasses cannot access parent #private members — this silently breaks class hierarchies. 🔹 Testing & mocking pain You can’t spy, mock, or patch #private fields. Existing unit tests often fail with no easy workaround. 🔹 Framework edge cases (Angular / NgRx) Angular DI can’t inject into #private fields NgRx state, actions, and DevTools don’t play well with non-serializable private data 🔹 Debugging & logging Private fields don’t appear in: console.log JSON.stringify crash reports → makes production debugging harder ✅ When #private makes sense Small utility classes Leaf-level helpers No inheritance No external access needed ❌ When to avoid it Large legacy codebases Shared models / services Angular services, NgRx state Code that relies on testing or extension 📌 Takeaway #private is not a drop-in replacement for existing patterns. In many production apps, TypeScript private/protected or _convention is still the safer choice. Curious to hear — Have you used #private in production yet? What was your experience? #JavaScript #Frontend #WebDevelopment #Angular #React #NodeJS #TypeScript #ProductionLessons #CleanCode
To view or add a comment, sign in
-
Rails framework code is full of inheritance magic, but your application code doesn't have to be. Learn how composition makes dependencies explicit, testing easier, and debugging a breeze—using patterns you already know from JavaScript.
A JavaScript developer's guide to Rails: What does Composition Over Inheritance mean? thoughtbot.com 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