🚨 JavaScript Tricky Question #1 What will be the output of this code? 🤔 console.log("Start"); setTimeout(() => { console.log("Timeout"); }, 0); Promise.resolve().then(() => { console.log("Promise"); }); console.log("End"); 💬 Comment your answer 👇 🔁 Follow for daily JS questions #javascript #webdevelopment #frontend #developers #programming #coding #nodejs #reactjs #softwareengineering
JavaScript Execution Order: 'Start', 'End', 'Timeout', 'Promise'
More Relevant Posts
-
🚨 JavaScript Tricky Question #2 (Hard) What will be the output? 🤯 for (var i = 0; i < 3; i++) { setTimeout(() => { console.log(i); }, 1000); } 💬 Comment your answer 👇 🔁 Follow for daily JS questions #javascript #webdevelopment #frontend #developers #coding #nodejs #reactjs #interviewprep #programming
To view or add a comment, sign in
-
🚀 Default Export vs Named Export in React — Stop Confusing Them! 🔹 Default Export ✔ Only one per file ✔ No curly braces needed ✔ You can rename it while importing export default Header; import MyHeader from "./Header"; --- 🔹 Named Export ✔ Multiple exports allowed ✔ Must use curly braces ✔ Name must match while importing export const add = () => {}; import { add } from "./utils"; --- 🔥 Key Difference 👉 Default = One main thing 👉 Named = Multiple utilities --- Nishant Pal 💬 Which one do you use more — Default or Named? #ReactJS #JavaScript #WebDevelopment #Frontend #Coding #Developers #LearnToCode
To view or add a comment, sign in
-
-
Ever spent hours chasing bugs only to find the simplest mistake? You write code. It doesn’t work. You spend hours debugging. Then suddenly… the bug reveals itself — in the least expected way. Sometimes, the breakthrough is just one insight away. Keep going. #FullStackDeveloper #MERNStack #NodeJS #ReactJS #JavaScript #RESTAPI #ReduxToolkit #TailwindCSS #WebDevelopment #FrontendDevelopment #BackendDevelopment #ResponsiveDesign #TechSolutions #UserFocusedDesign #SoftwareEngineering #CodingLife #DeveloperCommunity #ModernWebApps #ProgrammingTips #WebDevProjects
To view or add a comment, sign in
-
-
JS Pop Quiz: Did we just overwrite the Admin?! Let’s see who really understands JavaScript memory allocation! 👨💻👩💻 Look at the code snippet from @codewithsarir. We have a user1 object. We assign it to user2, and then change user2's role to 'Guest'. Question: What does console.log(user1.role) actually print? A) 'Admin' (Because we only changed user2) B) 'Guest' (Because they share the same reference) C) undefined D) It throws a TypeError Hint: Think about how JavaScript handles Objects versus Primitive types like strings. Does = make a copy, or just point to the same address? 🤔 Drop your guess in the comments before you test it in your IDE! 👇 Hashtags: #JavaScript #CodingQuiz #WebDesign #ProgrammerLife #Developers #LearnToCode #JS #Frontend #creators #codinglife #programmer
To view or add a comment, sign in
-
-
Javascript concept: Data Types A small mistake cost me hours debugging. let a = 10; let b = a; b = 20; console.log(a); // 10 But then: let obj1 = { name: "JS" }; let obj2 = obj1; obj2.name = "React"; console.log(obj1.name); // React 💡 Lesson: Primitives → copy by value Objects → copy by reference #JavaScript #WebDevelopment #Frontend #Coding
To view or add a comment, sign in
-
How does an EventEmitter actually work? I broke it down by building a functional mini-nodemon CLI from first principles. If you're into Node.js internals, this one is for you. Read more: https://lnkd.in/diw6tqxh #SoftwareEngineering #NodeJS #JavaScript #TypeScript #WebDev #SystemDesign #Coding #BuildInPublic
To view or add a comment, sign in
-
-
1) Asynchronous JavaScript (Must Know for Developers) Understanding async concepts is very important for writing efficient and clean JavaScript code. 🔹 Callbacks – Old approach (can lead to callback hell ) 🔹 Promises – Better handling with .then() & .catch() 🔹 Async/Await – Modern, clean, and readable 🔹 Fetch API – Handle API calls easily 🔹 Axios – Popular library for HTTP requests From Callbacks ➝ Async/Await Write clean & maintainable code Boost your development skills #JavaScript #AsyncJS #WebDevelopment #Frontend #Coding #Developers #Programming #LearnToCode⭐💫........
To view or add a comment, sign in
-
-
Functional vs Class Components – What Should You Choose Today? React has come a long way, and the way we build components has changed with it. ✔️ Understand the core differences & syntax ✔️ Know when to use each (and the reasoning behind it) ✔️ Explore performance considerations ✔️ Final takeaway for 2026 Hint: One clearly stands out as the preferred approach now! 🏆 What’s your go-to choice? Share your thoughts below 👇 #ReactJS #WebDevelopment #Frontend #JavaScript #Programming #TechTips
To view or add a comment, sign in
-
⚠️ React bug that makes you question reality? 😵💫 You update state… but your logic still uses the OLD value 😶 👉 That’s a stale closure. Your function “remembers” outdated state because of how closures work in JavaScript. 💥 Common symptoms: ❌ Counters not updating ❌ Async calls using old data ❌ UI behaving randomly 🚀 Quick fixes: ✅ Use functional updates (prev => ...) ✅ Fix missing dependencies in useEffect ✅ Use refs for always-fresh values 🔥 Thumb rule: Async + state = double check for stale closures 💬 Ever lost hours on this? Share your story 👇 #ReactJS #React #JavaScript #FrontendDevelopment #WebDevelopment #SoftwareEngineering #FullStack #Programming #CodingLife #Developers #DevCommunity #TechCommunity #CodeNewbie #LearnToCode #100DaysOfCode #Frontend #WebDev #JS #ReactDeveloper #SoftwareDeveloper #CodingTips #Debugging #CleanCode #TechTips #BuildInPublic #DEV #Engineering #ProgrammerLife #TechCareer #CodeDaily
To view or add a comment, sign in
-
-
Ever seen: “Warning: Text content did not match. Server: … Client: …” That’s hydration mismatch. Server-rendered HTML doesn’t match what React renders on the client. Common causes: Using window/document directly Client-only conditional rendering DOM-manipulating libraries Tip: Use useEffect or dynamic imports (ssr: false) for client-only code. Hydration issues are subtle—but they can break your UI in production! #NextJS #ReactJS #WebDevelopment #Frontend #JavaScript #Programming #TechTips #WebDev
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
Start, End, promise, timeout