🚀 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
More Relevant Posts
-
🚀 What I Learned Today – JavaScript Basics Today I revised some important concepts in JavaScript: 🔹 Loops (for, while, do-while, for...of, for...in) 🔹 Infinite loop and why it should be avoided 🔹 Strings and how they store text 🔹 String properties (length, indexing) 🔹 Template literals & string interpolation 🔹 String methods (toUpperCase, trim, slice, replace, etc.) Also understood that strings are immutable in JavaScript. Small steps every day to become a better developer 💻 #JavaScript #WebDevelopment #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
-
Continuing my Frontend revision, sharing my handwritten notes on JavaScript concepts. While learning JavaScript, I realized how important it is to understand how strings and arrays actually work. These cover string methods, method chaining, arrays, array methods, and basic operations on arrays. Sharing in case it helps anyone learning JavaScript fundamentals. JavaScript Notes – Part 3 #JavaScript #WebDevelopment #StudentDeveloper #Consistency #ComputerScience
To view or add a comment, sign in
-
🚨 Many beginners get confused between var, let, and const in JavaScript. They all create variables… but they behave very differently. If you understand this early, your JavaScript code will be cleaner and safer. Here is the simple difference 👇 • var Old way to create variables. It is function scoped and can be re-declared and updated. • let Modern JavaScript variable. It is block scoped and can be updated but not re-declared in the same scope. • const Used for values that should not change. It is block scoped and cannot be re-assigned. Quick tip 💡 Use const by default, let when value changes, and avoid var in modern JavaScript. Small concepts like this make a big difference in writing better code. #javascript #webdevelopment #frontenddevelopment #codingtips #learnjavascript #programmingbasics #softwaredevelopment #devcommunity #100daysofcode #javascriptdeveloper
To view or add a comment, sign in
-
-
🚀 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
-
-
just built a digital clock using javascript. sounds simple, but not gonna lie… seeing time update automatically felt cooler than it should have . Finally understanding how javascript actually makes a webpage *do* things instead of just sitting there looking pretty. small project, but big confidence boost. trying to move from “watched tutorial” to “ok wait I can build stuff now”. github link in comments. #buildinpublic #javascript #codingjourney #learning
To view or add a comment, sign in
-
Implemented Selection Sort in JavaScript, where the smallest element is selected in each iteration and placed at its correct position. A simple yet effective way to understand sorting fundamentals and in-place operations. #JavaScript hashtag#DSA hashtag#Algorithms hashtag#Coding hashtag#WebDevelopment
To view or add a comment, sign in
-
-
Day 2 of My JavaScript Journey 🚀 Today, I learned about values and variables in JavaScript. Values are the most fundamental unit of information in programming. Everything in JavaScript is built around values; numbers, text, true/false, etc. Variables, on the other hand, are like containers (or boxes) used to store these values so they can be reused later in a program. For example: let age = 20; Here, "20" is the value, and "age" is the variable storing it. One simple way to understand it: Values = the data Variables = where the data is stored Key takeaway: Variables make it easier to manage and reuse data efficiently in your code. I’m documenting my journey daily as I grow in JavaScript. #JavaScript #WebDevelopment #LearningInPublic #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 944 of #1000DaysOfCode ✨ Understanding Temporal Dead Zone in JavaScript JavaScript can sometimes behave in unexpected ways — especially when it comes to variable declarations. In today’s post, I’ve explained the concept of the Temporal Dead Zone (TDZ) in a simple and practical way, so you can understand why accessing variables before declaration can throw errors. The TDZ is the time between when a variable is hoisted and when it is actually initialized. This is why variables declared with `let` and `const` behave differently compared to `var`. Understanding this concept helps you avoid tricky bugs and write more predictable and cleaner code. If you’re working with modern JavaScript, knowing how TDZ works is essential for debugging and writing reliable applications. 👇 Have you ever faced a TDZ-related error without knowing the reason? #Day944 #learningoftheday #1000daysofcodingchallenge #FrontendDevelopment #WebDevelopment #JavaScript #React #Next #CodingCommunity #AsyncJavaScript
To view or add a comment, sign in
-
🚀 Day 1/30 – JavaScript Challenge LeetCode 2667 – Create Hello World Function 🧩 Problem: Write a function that returns a new function. That new function should always return "Hello World", no matter what arguments are passed. 🧠 Explanation: createHelloWorld() returns another function. The returned function uses (...args) to accept any number of arguments. But we ignore all inputs and always return "Hello World". 💡 Key Concept: This problem is based on: Higher Order Functions (function returning function). Rest Parameters (...args). Function independence from input. #javascript #30Days #Leetcode
To view or add a comment, sign in
-
-
Day 2/100 of JavaScript 🚀 Today’s Topic: "let", "const", "var", hoisting and TDZ. "var", "let", and "const" are used to declare variables, but they differ in scope and initialization behavior - "var" is function-scoped and during the creation phase it gets initialized with "undefined", so it can be accessed before assignment. - "let" and "const" are block-scoped and are registered in memory during creation, but not initialized immediately. This leads to TDZ (Temporal Dead Zone) a phase where the variable exists in memory but remains uninitialized and cannot be accessed. Accessing "let" or "const" variables before initialization results in a ReferenceError. - "const" must be initialized at declaration and cannot be reassigned. - "let" allows reassignment but not redeclaration in the same scope. These differences make "let" and "const" more predictable and safer compared to "var". #Day2 #JavaScript #100DaysOfCode
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 score = 0; //Q1 let q1 = prompt("Guess the next number:\n2, 4, 8, 16, ?"); if (Number(q1) === 32) { alert("Correct!"); score++; } else { alert("Wrong! Correct answer is 32"); } // Q2 let q2 = prompt("Guess the next number:\n3, 6, 9, 12, ?"); if (Number(q2) === 15) { alert("Correct!"); score++; } else { alert("Wrong! Correct answer is 15"); } // Q3 let q3 = prompt("Guess the next number:\n5, 10, 20, 40, ?"); if (Number(q3) === 80) { alert("Correct!"); score++; } else { alert("Wrong! Correct answer is 80"); } alert("Your score: " + score + " / 3"); let playAgain = confirm("Play again?"); if (playAgain) { location.reload(); } else { alert("Thanks for playing!"); }