## DAY 2 — Captcha Generator Day 2/30: Built a Captcha Generator from scratch. It creates randomized text and validates user input against it. No libraries, no APIs — just canvas rendering and string manipulation. The tricky part: making the captcha distorted enough to be hard to OCR but readable enough for humans. Turns out that balance is harder than it sounds. 🔗 Live: https://lnkd.in/gPzprnKc 🔗 Code: https://lnkd.in/gbqKTYrp #30DaysOfCode #JavaScript #WebDevelopment #BuildInPublic #WomenInTech
Building a Captcha Generator from Scratch in JavaScript
More Relevant Posts
-
I thought I understood map(), filter() and reduce()… until I wrote their polyfills. We use these methods daily in JavaScript. But I wanted to understand what actually happens behind the scenes. Building polyfills is one of the best ways to master: 1️⃣ Prototypes: How inheritance actually works in JS. 2️⃣ Execution Context: Mastering the behavior of this. 3️⃣ Edge Cases: Handling reduce() accumulators without an initial value. I’ve put together a deep dive into these internals. What’s inside: The logic behind Array.prototype. Step-by-step custom implementations. The "hidden" index logic in .reduce(). Which polyfill was the hardest for you to learn? Let’s discuss below! #Javascript #Chai aur Code #Polyfills
To view or add a comment, sign in
-
Arrow Functions — the modern way to write functions Here's the thing about arrow functions. They don't do anything a regular function can't do. They just do it in far fewer characters. And once you see them inside map() and filter(), you never want to go back. In this chapter I cover: → What arrow functions are and why they exist → Basic syntax with a full anatomy diagram (every part labelled) → One parameter — when you can drop the parentheses → Multiple parameters — when they come back → Implicit return vs explicit return (the biggest shortcut) → Arrow vs normal function — comparison table The moment it clicks for most people: Instead of: const doubled = numbers.map(function(n) { return n * 2; }); You write: const doubled = numbers.map(n => n * 2); Same result. One line. Instant readability. Link : https://lnkd.in/gJJV8ARv checkout the hashnode profile : https://lnkd.in/gAwxuryw #JavaScript #ES6 #WebDevelopment #LearnToCode #Frontend #JSFundamentals #chaicode #hoteshchoudhary #piyushgargh
To view or add a comment, sign in
-
-
LeetCode Problem: Longest Common Prefix What I Learned: • How nested loops simulate 2D comparison (character index vs string index) • Comparing each string character with the first string as a reference • Using the OR operator (||) to handle multiple stopping conditions • Understanding short-circuit evaluation to prevent unnecessary checks • How .slice(0, i) extracts the valid prefix before mismatch • Why return immediately stops the entire function execution • Handling edge cases like complete match or no common prefix • Writing an efficient O(n × m) solution using simple iteration logic Problem Summary: You’re given an array of strings and need to find the longest common prefix among them. The core idea is: Compare each character of the first string With the same position in all other strings. If: • A string becomes shorter • OR characters don’t match → Stop immediately and return the prefix until that index. If no mismatch is found after full iteration → return the entire first string. This problem strengthened my understanding of control flow, string indexing, and early returns in JavaScript. A great example of breaking execution at the right time instead of overcomplicating logic. #100DaysOfLeetCode #leetcode #javascript #problemsolving #codingjourney #DSA #StringManipulation #AlgorithmicThinking Link: https://lnkd.in/gnvmJK-r
To view or add a comment, sign in
-
-
🚀 Day 2/30 – Random Color Generator Continuing my 30 Days JavaScript Challenge. Today I built a Random Color Generator using HTML, CSS, and JavaScript. What it does: 🎨 Generates a random HEX color 🖱 Changes background on button click 🔢 Displays the color code dynamically What I learned: ✔ Math.random() logic ✔ DOM manipulation ✔ Updating styles dynamically ✔ Handling events properly Small projects, but strong fundamentals 💪 Live Demo: https://lnkd.in/gTw_h_G3 GitHub Repository: https://lnkd.in/gci2tTXc 28 more projects to go 🚀 #javascript #webdevelopment #codingjourney #30daysofcode #mernstack
To view or add a comment, sign in
-
-
In June 2021, I wrote an in-depth guide about sorting arrays in JavaScript. It's still one of the best resources to go through. It covers a wide range of the following topics: → Sorting Arrays Alphabetically → Sorting Strings with Non-ASCII Characters → Sorting Array Elements Numerically → ... Provided examples and use cases. Link in the comments. --- ♻️ If you liked it, let others know! #js #javascript #array #sorting
To view or add a comment, sign in
-
-
This image explains how the JavaScript map() function works to create images dynamically from an array. It shows that map() loops through a list of image paths, creates a new <img> element for each item, and then appends those images to a webpage. The diagram visually demonstrates the step-by-step process from array → mapping → generated images → displayed on the page. 🚀 #JavaScript #WebDevelopment #LearnToCode #Frontend
To view or add a comment, sign in
-
-
Understanding algorithms > memorizing them. Built two visualizers with vanilla JavaScript to see how sorting and pathfinding actually work. Sorting Visualizer: → Bubble, Quick, Merge sort with live animations → Two-pointer movement visible in real-time → Adjustable speed control Pathfinding Visualizer: → BFS, DFS, A* algorithms → Set start/end points, draw walls → Watch the search + shortest path highlight live Why vanilla JS? Sometimes constraints force better problem-solving. Seeing i and j pointers swap values beat reading about it 10 times over. Live: https://lnkd.in/gDahVKqv Github: https://lnkd.in/geSEKPhy What algorithm would you want visualized? 👇 #JavaScript #DSA #Algorithms #WebDev #VanillaJS
To view or add a comment, sign in
-
🔍 Prototypes and this in JavaScript — going beyond the syntax into the actual mechanics. Here's what's worth knowing: 🧬 On Prototypes Methods aren't copied to every object instance. They live once on the prototype — all instances share them via reference. That's how JS stays memory efficient even with thousands of objects. Every method lookup is a live chain traversal, every single time. Object.create is pure prototype wiring — it sets the [[Prototype]] of a new object. That's it. 🎯 On this — four rules, in priority order 1️⃣ new binding → this = newly created object 2️⃣ Explicit binding → .call() .apply() .bind() — you decide 3️⃣ Implicit binding → obj.method() — this = object left of the dot 4️⃣ Default binding → standalone call — this = window or undefined Arrow functions sit outside all four rules — they inherit this lexically from wherever they were defined. ⚠️ The classic trap js setTimeout(this.log, 1000); // this is lost Detach a method from its object and this evaporates. Fix → arrow wrapper, .bind(), or bind in the constructor. Each has different tradeoffs. 🧠 On EventEmitters and memory Per-instance state must always be initialized in the constructor. If it accidentally lands on the prototype — every instance shares the same object. Emitting on one instance fires callbacks registered on all instances. Silent. No error thrown. Every .on() listener holds a closure reference — keeping objects alive in memory long after they're "destroyed." Always implement .off(). Always clean up. Follow along — sharing one deep dive at a time. 🚀 #JavaScript #Prototypes #FrontendEngineering #WebPerformance #PlatformEngineering
To view or add a comment, sign in
-
#Hello_Connections #Day16 of #100DaysofCodeChallenge Project Name: JavaScript Calculator Details:Built a fully functional Calculator using HTML, CSS, and JavaScript that performs basic arithmetic operations with a clean and responsive UI. What I Focused On: DOM manipulation with JavaScript Handling button click events Implementing calculation logic Using JavaScript string methods for delete functionality Creating a structured grid layout using CSS Grid Key Features: Perform basic arithmetic operations (+ − × ÷) AC (clear all) and DEL (delete last digit) functionality Responsive grid-based button layout Clean modern UI with gradient background Challenges:Handling invalid expressions and preventing the calculator from breaking when incorrect inputs are entered. How I Solved It:Used a try...catch block around the eval() function to safely evaluate expressions and display "Error" when invalid calculations occur. This project helped me practice JavaScript event handling, DOM manipulation, and building functional UI components. Code Of School -Avinash Gour & Ritendra Gour #Day16 #100DaysOfCode #FrontendDevelopment #HTML #CSS #JavaScript #WebDevelopment #LearningInPublic 🚀
To view or add a comment, sign in
-
🚀 Array Flatten in JavaScript — Quick Concept Nested arrays like [1, [2, 3], [4, [5, 6]]] can be tricky to work with. Flattening helps convert them into a simple structure: 👉 [1, 2, 3, 4, 5, 6] 💡 Why it matters: ✔️ Cleaner data handling ✔️ Easier iteration & transformations ✔️ Common in real-world APIs ✔️ Frequently asked in interviews 🧠 Popular approaches: 🔹 flat() — simple & built-in 🔹 Recursion — best for interviews 🔹 reduce() — functional style 🔹 Stack — iterative solution 👉 Rule to remember: If it’s an array → go deeper, else collect it 📌 Check out the sketchnote infographic for a quick visual understanding! Read the full guide:- https://lnkd.in/gYhbZRpw Chai Aur Code #JavaScript #Coding #WebDevelopment #InterviewPrep #DevTips #chaicode #chaiaurcode
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