🚀 Day 1 of JavaScript Pattern Practice! Today I practiced building a simple star pattern using JavaScript functions. Patterns are a great way to improve your logic and get comfortable with loops. Here's the code I wrote: // Function to print star pattern function printStars(rows) { for (let i = 1; i <= rows; i++) { console.log('*'.repeat(i)); } } // Call the function printStars(4); Output: * ** *** **** ⭐ Key Learnings: Using for loops to control rows Using string.repeat() to create repeated characters Functions help in reusing code easily Looking forward to learning more patterns in the coming days! 💻 #100DaysOfCode #JavaScript #Coding #FrontendDevelopment #Patterns #LearnToCode
JavaScript Star Pattern Practice with Loops and Functions
More Relevant Posts
-
Instead of just using .map(), I tried implementing it myself using Array.prototype polyfills to understand how it actually works internally. The idea is simple: Loop through the array Run a callback on each element Store the returned value in a new array Return the new array at the end Small exercise, but it really helps understand what JavaScript is doing behind the scenes when we call built in methods. Sometimes writing things from scratch teaches more than just using the method. Hitesh Choudhary Chai Aur Code Akash Kadlag Jay Kadlag #javascript #webdevelopment #frontenddevelopment #learninginpublic #coding #chaiaurcode
To view or add a comment, sign in
-
-
So you wanna know lexical scoping? 👀 here is the easy way... But before that, you need to understand two small things. 1. Scope Scope just means where you can access a variable in your code. function greet() { let message = "Hello"; console.log(message); // works here } console.log(message); // error Here "message" only exists inside the function. 2. Lexical Lexical simply means where something is written in the code. JavaScript decides scope by how the code is structured, not where a function is called. For example: function outer() { let name = "sharat"; function inner() { console.log(name); } inner(); } "inner()" can access "name" because it was written inside "outer()". When JavaScript looks for a variable, it first checks the current scope, then moves to the outer scope, and keeps going until it reaches the global scope. That’s basically lexical scoping. all thanks to Sheryians Coding School and Devendra Dhote #javascript #webdevelopment #frontend #coding
To view or add a comment, sign in
-
-
Just published a new JavaScript article 🚀 Topic: Understanding Objects in JavaScript Covered: • What objects are and why we use them • Creating objects • Dot vs bracket notation • Updating, adding, deleting properties • Looping through object keys Objects are everywhere in JavaScript — mastering them strengthens your fundamentals 💻 If you're learning JS, this is an important concept. Read the full article here 👇 👉 https://lnkd.in/gZsXX3nr Akash Kadlag Chai Aur Code Jay Kadlag Anirudh J. Piyush Garg Hitesh Choudhary #Programming #WebDev #Blog #JavaScript #FrontendDevelopment #FrontendDeveloper #Coding #Frontend #Beginners #WebDevelopment #LearnToCode #Consistency #100DaysOfCode #CodingJourney #ContinuousLearning #Learning #LearningJourney #LearnInPublic #LearningInPublic #chaicode #ChaiCode #Cohort #Cohort26 #Cohort2026
To view or add a comment, sign in
-
-
🚀 30 Days of JavaScript – Day 8 Continuing my journey to improve my JavaScript logical thinking by building small programs every day. 💡 Today’s Mini Project: Random Color Generator This program randomly selects a color and changes the background color of the page. 🧠 Concepts Used: Arrays Math.random() confirm() and alert() Basic DOM manipulation 🎥 Demo video below 👇 Full source code in the First comment. #JavaScript #WebDevelopment #CodingJourney #FrontendDeveloper #LearningJavaScript #30DaysOfCode
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
-
-
🚀 Weekly Progress Update Last week was all about strengthening my JavaScript fundamentals and improving problem-solving skills. Here’s what I worked on: ✅ Deep dive into Event Handling Event Bubbling Event Capturing Event Delegation ✅ Practiced and solved 40+ string-based problems to improve logic building ✅ Gained hands-on experience with: DOM Manipulation BOM (Browser Object Model) ✅ Built a form project applying real-world concepts of events, DOM, and validation This week helped me better understand how JavaScript works behind the scenes and how to write cleaner, more efficient code. Looking forward to learning more and building stronger projects ahead 💻🔥 #JavaScript #WebDevelopment #LearningJourney #FrontendDeveloper #Coding #100DaysOfCode
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
-
-
🚀 Day 5 of #100DaysOfCode Built a Dice Roll Simulator using JavaScript. Features: 🎲 Random dice generation 🎲 Roll history tracking 🎲 Dynamic dice images Learning how randomness and DOM manipulation work together in JavaScript. Repo:-https://lnkd.in/geZqCnQ9 #JavaScript #WebDevelopment #100DaysOfCode
To view or add a comment, sign in
-
-
🚀 Day 86 of My #100DaysOfCode Challenge Today I discovered a lesser-known feature in JavaScript — Symbols. Most developers work with object keys using strings, but JavaScript also provides another unique type called Symbol. A Symbol creates a unique and hidden property key that cannot accidentally conflict with other keys. Example const id = Symbol("id"); const user = { name: "Tejal", [id]: 12345 }; console.log(user.name); // Tejal console.log(user[id]); // 12345 Why Symbols are interesting • Every Symbol is unique • Helps create hidden object properties • Prevents accidental property overwriting • Often used internally in libraries and frameworks Even if two symbols have the same description, they are still different. const a = Symbol("key"); const b = Symbol("key"); console.log(a === b); // false Learning about features like Symbols helps me understand how JavaScript works behind the scenes and how large applications manage object data safely. Exploring deeper concepts every day. 💻✨ #Day86 #100DaysOfCode #JavaScript #WebDevelopment #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
-
Have you ever faced unexpected behavior when copying objects in JavaScript? It’s a common mistake to assume that using `Object.assign` or the spread operator creates a deep copy. Imagine you're working in a team where one developer updates a nested object, only for others to see those changes reflected unexpectedly! The rule of thumb is to use `structuredClone` for complex objects to ensure you get a true deep copy. A hidden pitfall is that shallow copies only duplicate the first level of properties, leaving nested objects to reference the same memory. Remember, understanding these nuances can save you from debugging headaches and help you write cleaner, more predictable code! Keep leveling up your JavaScript skills, and you'll become the go-to developer on your team! ✨🚀💻 #programming #webdev #coding #javascript #structuredClone
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