🚀 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
More Relevant Posts
-
🚀 What I Learned Today – JavaScript Arrays Today I explored Arrays in JavaScript and here are the key takeaways 👇 🔹 Arrays are a collection of items 🔹 They are linear (elements stored sequentially) 🔹 Arrays are mutable (can be changed after creation) 📌 Array Indices Positions of elements in an array (starting from 0) 📌 Looping Through Arrays Used to print or access all elements easily 📌 Useful Array Methods ✔️ push() – add element to end ✔️ pop() – remove element from end ✔️ unshift() – add element to start ✔️ shift() – remove element from start ✔️ toString() – convert array to string ✔️ concat() – merge arrays ✔️ slice() – get part of array (no change to original) ✔️ splice() – modify array (add/remove/replace) 💡 Example: slice(start, end) splice(start, deleteCount, newElement) Learning step by step and building strong fundamentals 💪 #JavaScript #WebDevelopment #CodingJourney #FrontendDevelopment #100DaysOfCode)
To view or add a comment, sign in
-
-
💻 JavaScript Beginner Level Practice – Factorial Program Today I practiced a JavaScript program to calculate the factorial of a number using recursion. function factorial(n){ if(n === 0 || n === 1){ return 1; } return n * factorial(n - 1); } console.log(factorial(5)); 📌 Output: 120 💡 Explanation: Factorial means multiplying all whole numbers from 1 to the given number. Example: 5! = 5 × 4 × 3 × 2 × 1 = 120. #JavaScript #BeginnerLevel #CodingPractice #WebDevelopment #LearningToCode
To view or add a comment, sign in
-
-
💻 JavaScript Beginner Level Practice – Find Largest Number in an Array Today I practiced a simple JavaScript program to find the largest number in an array. function findLargest(arr){ return Math.max(...arr); } console.log(findLargest([1, 5, 3, 9])); 📌 Output: 9 💡 Explanation: This program finds the largest number in an array using "Math.max()" and the spread operator ("..."). #JavaScript #BeginnerLevel #CodingPractice #WebDevelopment #Learning
To view or add a comment, sign in
-
-
🚀 Day 67 | JavaScript Loops & Array Iteration Today I practiced JavaScript loops and working with arrays of objects 💻 🔹 What I Worked On: • Iterated through array of objects using for loop • Printed all elements and accessed object properties like loc • Used loop with step increment (i += 2) to print alternate values • Practiced reverse counting using for and while loops • Used forEach() for cleaner array iteration 💡 Key Learning: • Arrays of objects are very common in real-world applications • Loop conditions must be handled carefully (i < length vs <= length) • forEach() is simple and readable for iteration • Multiple ways to loop → choose based on requirement 🔥 Takeaway: 👉 Mastering loops is key to handling data efficiently in JavaScript Consistency is improving logic step by step 🚀 #Day67 #JavaScript #Loops #ArrayIteration #ProblemSolving #CodingJourney #10000Coders #WebDevelopment #SravanKumarSir
To view or add a comment, sign in
-
Day 66 | JavaScript Loops & Array Iteration Today I practiced JavaScript loops and working with arrays of objects🧑🏻💻 - What I Worked On: •Iterated through array of objects using for loop •Printed all elements and accessed object properties like loc •Used loop with step increment (i += 2) to print alternate values •Practiced reverse counting using for and while loops •Used forEach() for cleaner array iteration 💡 Key Learning: •Arrays of objects are very common in real-world applications •Loop conditions must be handled carefully (i < length vs <= length) •forEach() is simple and readable for iteration •Multiple ways to loop → choose based on requirement Takeaway: Mastering loops is key to handling data efficiently in JavaScript Consistency is improving logic step by step #Day66 #JavaScript #Loops #Arraylteration #ProblemSolving #CodingJourney #10000Coders #WebDevelopment #SravanKumarSir
To view or add a comment, sign in
-
🚀 Practicing Selection Sort in JavaScript Today I spent some time strengthening my understanding of sorting algorithms by implementing Selection Sort on a single array using JavaScript. 🧠 My Approach: 1. Loop through the array 2. Track the index of the smallest element 3. Use an if condition to compare and update the minimum value 4. Swap it with the current position 🖋️ Example : let arr = [23,3,41,12,2,56,15] ; and the result is : [2,3,12,15,23,41,56] 📈 Time Complexity: Best Case : O(n²) Average Case : O(n²) Worst Case : O(n²) 📌 Key Takeaway: Selection Sort is all about selection + swapping. Simple logic, but powerful for building strong foundations. 🔗 Check out my GitHub for the full code. #JavaScript #DSA #CodingPractice #Algorithms #SelectionSort #LearningJourney 😊
To view or add a comment, sign in
-
> Day 12/21 : JavaScript Control Flow As part of my 21-Day Full Stack Revision Challenge, today I revised control flow in JavaScript, which helps programs make decisions and repeat tasks. Control flow is important because it allows the program to execute different actions based on conditions. > Topics I Covered If–Else Statements – Used to execute code based on conditions Switch Statements – A cleaner way to handle multiple conditions Loops – Used to repeat a block of code multiple times > Why It Matters Control flow helps developers build logical and dynamic programs by controlling how and when code runs. Day 12 completed #FullStackDeveloper #JavaScript #WebDevelopment #LearningInPublic #21DaysChallenge #CodingJourney
To view or add a comment, sign in
-
Day 8 of Learning JavaScript 🚀 Today I explored arrays more deeply. One thing I realized: Arrays are not just lists — they are the foundation for handling data in real apps. Example use cases: • Displaying products on a website • Storing user inputs • Managing lists like tasks or messages I'm starting to see how basic concepts connect to real-world applications. #javascript #frontenddeveloper #learninginpublic
To view or add a comment, sign in
-
🚀 30 Days of JavaScript – Day 12 Can you solve these number puzzles? 🤔 Today I built a small JavaScript program that asks 3 number pattern questions and calculates the final score. 🧠 Concepts Used: conditional statements user input with prompt() variables and score tracking 🎥 Demo below 👇 Full source code in the First comment. #JavaScript #CodingChallenge #ProblemSolving #LearningJavaScript #WebDevelopment
To view or add a comment, sign in
-
Built a JavaScript (Node.js) program to check input type 💻 Used the readline module to take user input. Identified whether input is an alphabet, digit, or symbol. Applied conditional statements (if-else) for logic building. Handled both uppercase and lowercase alphabets. Used character range comparison effectively. Improved understanding of input validation. Practiced writing clean and readable code. Strengthening JavaScript fundamentals step by step 🚀 Learning logic building with real examples 🔥 #JavaScript #NodeJS #CodingJourney #LearnToCode #ProgrammingBasics #WebDevelopment #StudentDeveloper #LogicBuilding #TechSkills #VSCode
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
let play = confirm("Generate a random color?"); if (play) { let colors = ["red", "blue", "green", "yellow", "purple", "orange"]; let randomIndex = Math.floor(Math.random() * colors.length); let selectedColor = colors[randomIndex]; document.body.style.backgroundColor = selectedColor; alert("Your random color is: " + selectedColor); } else { alert("Maybe next time!"); }