💻✨ JavaScript Function Practice – Task Completed! This week, I focused on improving my function-building skills in JavaScript through hands-on coding challenges. Each task helped me apply logic, handle edge cases, and write cleaner, reusable code. Here’s what I worked on 👇 🟢 1. Greeting Function greetUser(name, times) — Greets a user multiple times and shows a warning if the count is invalid. 🟢 2. Rectangle Area & Perimeter calcRectangle(width, height) — Returns both area and perimeter of a rectangle, with error handling for invalid dimensions. 🟢 3. Flexible String Repeater repeatString(str, count, separator) — Builds a repeated string with a custom or default separator. 🟢 4. Parameterized Filter Function filterByLength(wordList, minLen, maxLen) — Filters an array of strings based on minimum and maximum word lengths, automatically swapping limits if needed. 🟢 5. Parameterized Calculator Function calculate(a, b, operation) — Performs add, subtract, multiply, or divide operations with smart error handling for zero division or invalid inputs. Each task strengthened my understanding of: ✅ Function parameters & return values ✅ Error handling & validation ✅ Logical problem-solving 💬 Excited to keep practicing and building more JavaScript-based utilities! #JavaScript #CodingPractice #WebDevelopment #ProblemSolving #LearnToCode #Functions #DeveloperJourney #JS #Coding #Coding #10000coders #spandanachowdary #MeghanaM
More Relevant Posts
-
💻✨ Mastering DOM Manipulation in JavaScript! Today, I explored how JavaScript interacts with the HTML structure using the Document Object Model (DOM) — a core skill for every front-end developer. 🚀 🧠 What I Practiced: 🔹 Selecting elements using getElementById(), getElementsByClassName(), getElementsByTagName(), and querySelector() 🔹 Modifying web content with innerText and innerHTML 🔹 Dynamically updating text and HTML elements without refreshing the page This hands-on session helped me understand how JavaScript brings life to web pages by making them interactive and dynamic! 💪 📸 Here’s a glimpse of my DOM learning project in VS Code 👇 Harish M.Spandana Chowdary,Bhagavathula Srividya,10000 Coders #JavaScript #DOMManipulation #FrontendDevelopment #WebDevelopment #HTML #CSS #Coding #Programming #Developer #SoftwareEngineering #LearnToCode #100DaysOfCode #WebDesign #Tech #CodeNewbie #Programmer #JavaScriptDeveloper #FrontendEngineer #WomenWhoCode #FullStackDeveloper #WebDevJourney #CodingLife #TechLearning #CodeWithMe #Developers #StudentDeveloper #VSCode #LearningJourney
To view or add a comment, sign in
-
-
🚀 JavaScript Methods You Must Know as a Developer JavaScript methods are the building blocks that make coding efficient and powerful. From working with strings and arrays to handling objects, these methods simplify our daily development tasks. Some must-know JS methods include: 📌 map(), filter(), reduce() for arrays 📌 toUpperCase(), slice(), replace() for strings 📌 Object.keys(), Object.values() for objects Understanding these methods will help you write cleaner, faster, smarter code. #JavaScript #WebDevelopment #FrontendDevelopment #JavaScriptConcepts #JavaScriptDeveloper #LearnJavaScript #Coding #Programming #FrontendDeveloper
To view or add a comment, sign in
-
We all grew up 🎉 From Fun Functions to Functional Coding in JavaScript!👨💻 Ever wondered how JavaScript organizes tasks and reuses logic efficiently? That’s where functions come into play! Let’s break it down simply 👇 1️⃣ Function Definition 🧩 A function is a block of code designed to perform a specific task. It’s defined using the function keyword. function greet() { console.log("Hello, World!"); } 2️⃣ Function Call 📞 Once defined, a function needs to be called to execute its code. greet(); // Output: Hello, World! 3️⃣ Parameters 🎛️ Parameters act like placeholders inside the function definition — they accept values when the function is called. function greetUser(name) { console.log("Hello, " + name + "!"); } 4️⃣ Arguments 🎯 Arguments are the actual values passed to the function’s parameters during a call. greetUser("Sethu"); // Output: Hello, Sethu! 5️⃣ Return Statement 🎁 Functions can return values to the caller using the return keyword. function add(a, b) { return a + b; } console.log(add(5, 3)); // Output: 8 ✨ In short: Functions = reusable blocks of logic 💡 Parameters = placeholders 🧠 Arguments = actual data 💬 Function Call = execution trigger 🚀 #JavaScript #Coding #WebDevelopment #ProgrammingBasics #LearnWithMe #JSFunctions #DeveloperCommunity
To view or add a comment, sign in
-
💻 Exploring DOM in JavaScript! 🎯 Today, I continued my journey of learning and experimenting with the Document Object Model (DOM) — one of the most exciting parts of JavaScript that helps bring web pages to life! 🌐 Here are some of the amazing tasks I worked on today 👇 🔹 Simple Math Calculator ➕➖✖️➗ – created a basic calculator using DOM manipulation where I handled user input and displayed real-time results. 🔹 Show/Hide Password Feature 🔒👁️ – implemented a toggle feature to hide or reveal the password using simple JS logic. 🔹 Swapping Content Between Two Paragraphs 🔁 – learned how to dynamically exchange content between elements on a click event. 🔹 Generating Random Background Colors 🎨 – added functionality to change the background color randomly, giving a fun interactive touch to the webpage. Each of these tasks helped me understand DOM events, element selection, and manipulation more deeply and improved my problem-solving and logic-building skills in JavaScript. 🚀 You can check out all my DOM tasks here on my GitHub 👇 🔗https://lnkd.in/dAhB6gjM #JavaScript #DOM #WebDevelopment #LearningJourney #FrontendDevelopment #Coding #100DaysOfCode #DeveloperJourney
To view or add a comment, sign in
-
👉✅ “Setting a one-week goal to revise JavaScript again.” 💻Topic-1. JavaScript Constructor Function Hey everyone, 👋 Today, let’s talk about an interesting JavaScript topic — the Constructor Function. This is a special type of function that helps us create multiple similar objects without writing the same code again and again! 🔁 🧠 Key points to understand: The name of a constructor function always starts with a capital letter. We use the new keyword when creating an object. It automatically returns a new object. Through this concept, we can explore the basics of Object-Oriented Programming (OOP) in JavaScript — including concepts like inheritance and encapsulation. 🚀 If you’re learning JavaScript, understanding constructor functions is a must-have skill — it makes your code cleaner, reusable, and more efficient! #JavaScript #WebDevelopment #CodingTips #ConstructorFunction #FrontendDevelopment #LearningEveryday
To view or add a comment, sign in
-
-
"Lessons from JavaScript" – Beyond the semicolons and frameworks, JavaScript has been a surprisingly profound teacher, offering insights that extend far beyond the realm of code. Here are a few life lessons I've picked up from my journey with JavaScript: There’s more than one way to do anything. Just like different approaches to solve a coding problem, life often presents multiple paths to a single destination. Embrace flexibility! You can’t control everything — async happens. Asynchronous operations are a core part of JS, and they're a constant reminder that some things are simply out of our immediate control. Learning to manage expectations and react to outcomes is key, both in code and in life. Naming things is the hardest problem. This isn't just a programming joke; it's a universal truth! Giving clarity and meaning to concepts, projects, or even emotions can be surprisingly challenging but incredibly rewarding. Simplicity > cleverness. Elegant, straightforward solutions often trump overly complex or "clever" ones. This applies to system design, communication, and even personal habits. console.log() fixes 80% of problems. Sometimes, all you need is a little more information, a moment to pause and observe. Debugging isn't just for code; it's for understanding situations and finding clarity. Programming is just life in syntax form. The logic, the challenges, the problem-solving, the collaboration – it all mirrors the human experience. Code is just another language we use to express and navigate complexity. What non-coding lessons have you learned from your programming journey? Share your thoughts below! 👇 #JavaScript #Programming #LifeLessons #SoftwareDevelopment #TechInsights #Coding
To view or add a comment, sign in
-
-
🍏 JS Daily Bite #9 — Understanding Function Prototypes Every function in JavaScript has a special property called prototype — the foundation of how inheritance and object construction work in the language. 🔍 The Function Prototype Property All functions (except arrow functions) have a default prototype property Arrow functions ❌ do not have a prototype The prototype object includes a constructor property that points back to the function Each prototype object’s [[Prototype]] links up to Object.prototype 🧱 Adding Properties to Prototypes You can attach properties or methods to a function’s prototype to make them automatically available to all instances created with that function. This is a memory-efficient way to share behavior across instances! ⚡️ 🧩 Creating Instances with new When you use the new operator: A new object is created Its [[Prototype]] is set to the function’s prototype property Instance-specific properties are initialized Shared methods are inherited through the prototype chain 🧭 How Property Lookup Works When accessing a property: JavaScript checks the object itself If not found, it climbs the prototype chain ([[Prototype]]) The search continues until Object.prototype If still not found, the result is undefined 🧠 Key Takeaways Instance properties override prototype properties Prototype properties are shared across all instances The chain always ends at Object.prototype.[[Prototype]] === null Mastering this mechanism is essential for deep JavaScript understanding 💪 🔜 Next in the Series → Comparing Ways to Create and Mutate the Prototype Chain #JavaScript #WebDevelopment #Programming #TechEducation #LearnToCode #SoftwareDevelopment #JSInsights #CodeLearning #Frontend #JSFundamentals #Prototypes #JSDailyBite
To view or add a comment, sign in
-
Today’s Tiny JavaScript Project I wrote a simple “Fortune Teller” script in JavaScript — it picks a random fortune each time you run it! let fortune1 = "Your cat will look very cuddly today."; let fortune2 = "The weather will be nice tomorrow."; let fortune3 = "Be cautious of your new neighbors."; let fortune4 = "You will find a new hobby soon."; let fortune5 = "It would be wise to avoid the color red today."; let randomNumber = Math.floor(Math.random() * 5) + 1; let selectedFortune = randomNumber; if (randomNumber === 1) selectedFortune = fortune1; else if (randomNumber === 2) selectedFortune = fortune2; else if (randomNumber === 3) selectedFortune = fortune3; else if (randomNumber === 4) selectedFortune = fortune4; else if (randomNumber === 5) selectedFortune = fortune5; console.log(selectedFortune); 🧠 It’s a small project, but a fun way to practice: Random number generation Conditional logic Console output What fortune did you get when you ran it? 👀 #JavaScript #Coding #WebDevelopment #100DaysOfCode #LearnToCode
To view or add a comment, sign in
-
Day 5 of #30DaysOfJavaScript: Creating My Own Filter Function from Scratch! 🎯 Today, I tackled a great exercise that challenged me to build a custom filter function without using JavaScript’s built-in .filter() method. This involved iterating over an array and using a callback function to decide which elements to keep based on truthy values. Here’s a peek at the solution I wrote: Key takeaways from this challenge: Deepened my understanding of higher-order functions and callback usage. Learned how to evaluate truthy and false values in JavaScript more effectively. Gained appreciation for the power and convenience of built-in array methods by implementing one manually. This hands-on approach is helping me grasp fundamental JavaScript concepts in detail while preparing for real-world coding challenges. Excited to keep growing and solving more problems along the way! Let’s connect and share knowledge. #JavaScript #CodingChallenge #WebDevelopment #LeetCode #ArrayMethods #LearningByBuilding #DeveloperJourney
To view or add a comment, sign in
-
-
Hey, Mates. How are you doing? You know, Even experienced devs trip over JavaScript quirks sometimes — here are a few I’ve seen (and made myself 😅 as well): 1. Using var instead of let or const var is function-scoped and can cause weird bugs due to hoisting. ✅ Use let for variables that change and const for ones that don’t. 2. Forgetting to handle async properly Mixing promises, callbacks, and async/await can lead to race conditions or unhandled rejections. ✅ Always await async functions or chain with .then(), and wrap in try/catch. 3. Comparing values incorrectly == does type coercion (and sometimes weirdly!). ✅ Stick to === for strict comparison. 4. Misunderstanding this Arrow functions don’t have their own this — they inherit from the parent scope. ✅ Know when to use arrow functions vs regular ones. 5. Not handling floating-point math 0.1 + 0.2 !== 0.3 (yes, really). ✅ Use libraries like decimal.js or round your values when precision matters. ⸻ These are small details — but they separate good JavaScript from great JavaScript. 💬 What’s a JS mistake you’ve seen (or made) that taught you something valuable? #JavaScript #WebDevelopment #Programming #CodingTips #Frontend
To view or add a comment, sign in
Explore related topics
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