𝗣𝗹𝗮𝘆𝘄𝗿𝗶𝗴𝗵𝘁 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 & 𝗧𝘆𝗽𝗲𝗦𝗰𝗿𝗶𝗽𝘁 – 𝗗𝗮𝘆 𝟴 𝗝𝘂𝗺𝗽𝗶𝗻𝗴 𝗦𝘁𝗮𝘁𝗲𝗺𝗲𝗻𝘁𝘀 Jumping statements are control statements that immediately change the normal flow of program execution. they jump from one place in the code to another place. 𝟭. 𝗕𝗿𝗲𝗮𝗸 used to break the loop intentionally, when a specific condition is met. 𝗯𝗿𝗲𝗮𝗸; 𝟮. 𝗖𝗼𝗻𝘁𝗶𝗻𝘂𝗲 used to skip the current iteration and move to the next iteration when a specific condition is met 𝗰𝗼𝗻𝘁𝗶𝗻𝘂𝗲; 𝟯. 𝗥𝗲𝘁𝘂𝗿𝗻 return exists a function and optionally send a value back to the caller ex: function add(a:number, b:number) : number{ 𝗿𝗲𝘁𝘂𝗿𝗻 a+b; } 𝟰. 𝗧𝗵𝗿𝗼𝘄 throw stops program execution by throwing an error. ex: function withdraw(amount:number){ if(amount<=0){ 𝘁𝗵𝗿𝗼𝘄 new Error ("Invalid Amount") } Follow me for regular insights on 𝗣𝗹𝗮𝘆𝘄𝗿𝗶𝗴𝗵𝘁 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻 𝗧𝗲𝘀𝘁𝗶𝗻𝗴. #JavaScript #TypeScript #NodeJS #Playwright #AutomationTesting #SoftwareTesting #QA #LearningInPublic #TestAutomation
Jayaprakash Manda’s Post
More Relevant Posts
-
𝗣𝗹𝗮𝘆𝘄𝗿𝗶𝗴𝗵𝘁 𝘄𝗶𝘁𝗵 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 & 𝗧𝘆𝗽𝗲𝗦𝗰𝗿𝗶𝗽𝘁 – 𝗗𝗮𝘆 𝟵 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀 A function is a reusable block of code designed to perform a specific task. 𝗲𝘅: function greet() { console.log("Hello World"); } 𝟭. 𝗡𝗮𝗺𝗲𝗱 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 A function with a specific name. Reusable and easier to debug. 𝗲𝘅: function greet(name) { return "Hello " + name; } console.log(greet("Jay")); 𝟮. 𝗔𝗻𝗼𝗻𝘆𝗺𝗼𝘂𝘀 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 A function without a name. Usually assigned to a variable or used as a callback. 𝗲𝘅: function run(greet: (name:String) => void ) : void { greet ("Prakash"); } 𝟯. 𝗔𝗿𝗿𝗼𝘄 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 Introduced in ES6. Shorter syntax and widely used in modern development. 𝗲𝘅: const greet = name => "Hello " + name; Follow me for regular insights on 𝗣𝗹𝗮𝘆𝘄𝗿𝗶𝗴𝗵𝘁 𝗔𝘂𝘁𝗼𝗺𝗮𝘁𝗶𝗼𝗻 𝗧𝗲𝘀𝘁𝗶𝗻𝗴. #JavaScript #TypeScript #NodeJS #Playwright #AutomationTesting #SoftwareTesting #QA #LearningInPublic #TestAutomation
To view or add a comment, sign in
-
This is a great GitHub repository by Airbnb that provides a comprehensive style guide for writing clean, consistent, and professional JavaScript 🔥 It’s a valuable resource for maintaining code quality and adhering to best practices in any project. Link 🔗: https://lnkd.in/dk9jG96j Hope this helps ✅ Do Like 👍 & Repost 🔄 #html #css #javascript #typescript #react #viral
To view or add a comment, sign in
-
💡 𝗧𝗶𝗽 𝗼𝗳 𝘁𝗵𝗲 𝗗𝗮𝘆 — 𝗥𝗲𝗮𝗰𝘁 𝗡𝗮𝘁𝗶𝘃𝗲 (𝗙𝗹𝗮𝘁𝗟𝗶𝘀𝘁 𝗢𝗽𝘁𝗶𝗺𝗶𝘇𝗮𝘁𝗶𝗼𝗻) 𝗗𝗶𝗱 𝘆𝗼𝘂 𝗸𝗻𝗼𝘄? "FlatList" re-renders items whenever its "extraData" prop changes. If you pass a large object (like full component state) into "extraData", you may unintentionally trigger 𝗳𝘂𝗹𝗹 𝗹𝗶𝘀𝘁 𝗿𝗲-𝗿𝗲𝗻𝗱𝗲𝗿𝘀. 🔧 𝗕𝗲𝘀𝘁 𝗽𝗿𝗮𝗰𝘁𝗶𝗰𝗲: - Keep "extraData" minimal - Memoize list items with "React.memo" when possible - Avoid passing unstable references Small optimization → smoother scrolling performance. #ReactNative #MobileDevelopment #PerformanceOptimization #JavaScript #AppDevelopment #SoftwareEngineering #CodingTips #React #FullstackDeveloper
To view or add a comment, sign in
-
-
⚡ Most developers accidentally make async JavaScript slower than it needs to be. A lot of people write async code like this: await first request wait… await second request wait… await third request It works. But if those requests are independent, you’re wasting time. The better approach: ✅ run them in parallel with Promise.all() That small change can make your code feel much faster without changing the feature at all. Simple rule: If task B depends on task A → use sequential await If tasks are independent → use Promise.all() This is one of those JavaScript habits that instantly makes you look more senior 👀 Join 3,000+ developers on my Substack: 👉 https://lnkd.in/dTdunXEJ How often do you see this mistake in real codebases? #JavaScript #WebDevelopment #Frontend #SoftwareEngineering #AsyncJavaScript #Promises #CodingTips #Developers #LearnToCode #AITechDaily
To view or add a comment, sign in
-
-
⚡ JavaScript Concept: Promises vs. Async/Await Stop the callback confusion! Choose the right tool for your async code. 🚀 🟢 Promises → The Foundation Action: Handles async operations via .then() and .catch(). Best for: Simple API fetches and parallel tasks. 🔴 Async/Await → The Standard Action: Cleaner syntax that reads like synchronous code. Best for: Complex logic and sequential API calls. #javascript #frontenddevelopment #reactjs #webperformance #webdevelopment
To view or add a comment, sign in
-
-
🧠 JavaScript Concept: Promise vs Async/Await Handling asynchronous code is a core part of JavaScript development. Two common approaches are Promises and Async/Await. 🔹 Promise Uses ".then()" and ".catch()" for handling async operations. Example: fetchData() .then(data => console.log(data)) .catch(err => console.error(err)) 🔹 Async/Await Built on top of Promises, but provides a cleaner and more readable syntax. Example: async function getData() { try { const data = await fetchData(); console.log(data); } catch (err) { console.error(err); } } 📌 Key Difference: Promise → Chain-based handling Async/Await → Synchronous-like readable code 📌 Best Practice: Use async/await for better readability and maintainability in most cases. #javascript #frontenddevelopment #reactjs #webdevelopment #coding
To view or add a comment, sign in
-
-
💡React Tip💡 Whenever you want to store an object in a state, use null as the initial value like this: const [user, setUser] = useState(null); instead of an empty object like this: const [user, setUser] = useState({ }); So if you want to check if user exist or if there are any properties present inside it, you can just use simple if condition like this: if(user) { // user exists, do something } or use JSX expression like this: { user && <p>User found</p>} However, If you use an empty object as the initial value, then you need to check like this: if(Object.keys(user).length === 0) { // user exists, do something } or use JSX expression like this: { Object.keys(user).length === 0 && <p>User found</p>} So assigning an initial value of null will make your code simpler and easier to understand. 𝗙𝗼𝗿 𝗺𝗼𝗿𝗲 𝘀𝘂𝗰𝗵 𝘂𝘀𝗲𝗳𝘂𝗹 𝗰𝗼𝗻𝘁𝗲𝗻𝘁, 𝗱𝗼𝗻'𝘁 𝗳𝗼𝗿𝗴𝗲𝘁 𝘁𝗼 𝗳𝗼𝗹𝗹𝗼𝘄 𝗺𝗲. #javascript #reactjs #nextjs #webdevelopment
To view or add a comment, sign in
-
One common issue in async JavaScript is repetitive try/catch blocks that make code messy and harder to maintain. A cleaner approach is the await-to pattern, which wraps promises and returns [error, data]. This keeps your async functions clean, readable, and easier to debug. ✅ No nested try/catch ✅ No swallowed errors ✅ Cleaner and reusable code ✅ Better error handling pattern Sometimes the best optimization is not adding more code — it’s removing repetition. What pattern do you use for handling async errors in your projects? #JavaScript #ReactNative #NodeJS #CleanCode #AsyncAwait #SoftwareDevelopment #WebDevelopment
To view or add a comment, sign in
-
-
💻 How Frontend and Backend Should Actually Communicate In many projects, frontend and backend integration becomes messy because APIs are not clearly structured. A few simple practices make this much smoother: 📡 Use clear and predictable API endpoints 📦 Send consistent response formats ⚠ Handle errors properly from the backend 🔑 Use proper status codes for responses When communication between frontend and backend is clean, development becomes much faster and easier. Good applications are not just about writing features — they’re about making systems work together smoothly. 👇 Check the carousel for a simple breakdown. #WebDevelopment #FrontendDevelopment #BackendDevelopment #APIDesign #JavaScript #SoftwareEngineering
To view or add a comment, sign in
-
🚀 Tired of Googling JavaScript syntax every 5 mins? I got you. Here's an Interactive JavaScript Cheatsheet — and it slaps. 🧠 No more flipping through docs ⚡️ Fast, searchable, and clean 🛠️ Covers ES6+, DOM, array/object methods, async/await & more 🌙 Dark mode ready ✅ Copy-paste code blocks 📱 Mobile-friendly (because yes, we debug on phones too) If it helps you code faster, share it with a friend or teammate! Follow Muhammad Nouman for more useful content #JavaScript #WebDevelopment #Frontend #CodingLife #DevTools #ReactJS #NodeJS #WomenWhoCode #100DaysOfCode #CodeNewbie #DeveloperTools #JavaScriptCheatsheet #BuildInPublic #TechForGood
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