Javascript Logic Challenge #2 — Reverse a Number Goal: Write a JavaScript program to reverse a number. Example: Input: 1234 Output: 4321 Step-by-Step : 1. Pick the last digit (using % 10) 2. Add it to a new number (reverse) 3. Remove the last digit (using Math.floor(num / 10)) 4. Keep doing it until no digits are left Every small code teaches me something new . guess the output #JavaScript #LogicBuilding #WebDevelopment #CodingJourney #FrontendDeveloper #LearningEveryday
How to Reverse a Number in JavaScript
More Relevant Posts
-
Keywords in JavaScript - JavaScript Tutorial 09 🚀 ► https://lnkd.in/ggh6CJ5Q ► In this tutorial, we dive into JavaScript keywords, explaining their use in defining variables, control flow, and more. Learn how to use them effectively to write clean, functional JavaScript code. JavaScript Tutorials Playlist: ► https://lnkd.in/g-TAmZZ3 #javascript #coding #programming #webdevelopment #learnjavascript #webdeveloper #coder #code #html #css
To view or add a comment, sign in
-
-
🚀 Learning Matrix Manipulation in JavaScript Today I learned how to handle matrices in JavaScript! I implemented a function called zeroMatrix() that sets entire rows and columns to 0 if any element in the matrix is 0. This helped me understand how nested loops, logical conditions, and 2D arrays work together — a great hands-on exercise for improving problem-solving skills in JS. #JavaScript #CodingJourney #WebDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
🚀 New Video in our DSA in JavaScript Series! In this video, we continue our Stack chapter 📚 — and solve two very popular stack problems in JavaScript 💻 You’ll learn step-by-step how to: ✅ Reverse a String using Stack ✅ Check for Balanced Parentheses (Brackets) Both are beginner-friendly but super important problems to understand how LIFO (Last In, First Out) works in real coding examples ⚙️ We’ll go through the full logic + code explanation and dry run everything inside VS Code 👇 💡 You’ll clearly understand: How Stack helps in Reversal & Matching problems Real use of push() and pop() How LIFO principle solves both questions Step-by-step dry run examples 🎥 Watch here → https://lnkd.in/etXYgrSp 📌 Watch the complete DSA in JavaScript playlist here: https://lnkd.in/g2qrGaSH 📂 Download the PPT for this topic here: https://lnkd.in/eejEhC3j #dsa #dsainjavascript #javascript #stack #datastructures #codingtutorial #dsaforbeginners #jdcodebase #javascriptdsa #stacktutorial
Stack Problems Part-1 in JavaScript | DSA Explained with Example | JDCodebase
https://www.youtube.com/
To view or add a comment, sign in
-
Keywords in JavaScript - JavaScript Tutorial 09 🚀 ► https://lnkd.in/gJPYxAec ► In this tutorial, we dive into JavaScript keywords, explaining their use in defining variables, control flow, and more. Learn how to use them effectively to write clean, functional JavaScript code. JavaScript Tutorials Playlist: ► https://lnkd.in/getnwV5e #javascript #coding #programming #webdevelopment #learnjavascript #webdeveloper #coder #code #html #css
To view or add a comment, sign in
-
-
🚀 Day 1 of How JavaScript Really Runs! Ever wondered what happens behind the scenes when you run your JavaScript code? 🤔 Here’s a quick breakdown of the magic inside the V8 engine 👇 1️⃣ Your JavaScript code — the human-readable code you write. 2️⃣ Parsing — the engine parses it into an Abstract Syntax Tree (AST) 🌲, which represents the structure of your code. 3️⃣ Interpreter (Ignition) — converts the AST into bytecode and starts executing it quickly. 4️⃣ Optimizing Compiler (TurboFan) — watches the execution and compiles frequently used parts into highly optimized machine code ⚡ 💡 This combination of interpreting and compiling helps JavaScript achieve both speed and efficiency, making it one of the most powerful languages for web development today. #JavaScript #V8Engine #WebDevelopment #Programming #DeveloperCommunity #LearningEveryday Sudheer Velpula
To view or add a comment, sign in
-
-
javascript Logic Challenge #3 how to count the digits of a number in JS Simple Explanation : Imagine a number like 567. We want to know how many numbers are inside it. So we do this: 1. Take the number 2. Remove the last digit 3. Each time you remove a digit - count +1 4. Stop when the number becomes 0 That’s it! Example: 567 - 3 digits I used a simple loop that removes one digit at a time and counts it. #JavaScript #Learning #LogicBuilding
To view or add a comment, sign in
-
-
🚀 JavaScript Practice: Prime Numbers from 1 to 100 Here's a simple yet classic logic-building problem — finding all prime numbers between 1 and 100 using JavaScript. Key learnings from this program: ✅ Nested loops usage ✅ Logical thinking with condition checks ✅ Introduction to algorithmic problem-solving 💡 Tech Used: JavaScript 👨💻 Concept: Prime Number Detection #JavaScript #Coding #100DaysOfCode #SoftwareEngineer #LearningInPublic #LogicBuilding #FrontendDevelopment
To view or add a comment, sign in
-
-
🚀 Day 6 of My 30 Days of JavaScript Challenge 🧩 Problem: Filter Elements from Array (LeetCode #2634) Given an integer array arr and a filtering function fn, return a new array filteredArr that only includes elements where fn(arr[i], i) returns a truthy value. Solve this without using the built-in Array.filter() method. 💻 Language: JavaScript ❓ Question: https://lnkd.in/eSGpgXcM 💡 Solution: https://lnkd.in/ekA6y-u3 🧠 Concepts Used: Higher-order functions and callbacks Conditional checks for truthy/falsy values Understanding Boolean(value) behavior in JavaScript 📚 Takeaway: Rebuilding filter() from scratch deepens understanding of conditional logic, iteration, and truthy/falsy evaluation — all essential for functional programming in JavaScript. #Day6 #JavaScript #30DaysOfCode #LeetCode #CodingChallenge #WebDevelopment #FrontendDevelopment #100DaysOfCode
To view or add a comment, sign in
-
✨ Day 9 — Mastering Functions in JavaScript (Part 1: The Fundamentals)! ✨ Today, I explored one of the most powerful and essential concepts in JavaScript — Functions! 💻 I started by understanding what a function really is — a reusable “code recipe” that helps us follow the DRY (Don’t Repeat Yourself) principle. 🔁 I learned about the anatomy of a function, including parameters vs. arguments, and the importance of the return keyword. Then, I discovered the difference between Function Declarations and Function Expressions, and how Hoisting works behind the scenes. To wrap up the fundamentals, I explored modern Arrow Functions (=>) — short, clean, and perfect for writing concise logic! ⚡ This session helped me understand how functions make our code modular, reusable, and easy to maintain — truly the foundation of JavaScript programming. 🚀 #Day9 #JavaScript #WebDevelopment #100DaysOfCode #LearningEveryday #Functions #FrontendDevelopment #CodingJourney #TechLearning
To view or add a comment, sign in
-
-
Mastering JavaScript Functions — From Basics to Advanced! I’ve just built a complete reference file covering all JavaScript function concepts — from declarations and arrow functions to closures, callbacks, async/await, and even generators! Every section includes a clear definition, explanation, and live example — all written cleanly so you can run it directly in VS Code. This project helped me deeply understand how functions work behind the scenes in JavaScript, including concepts like hoisting, ‘this’ behavior, and higher-order functions. #JavaScript #WebDevelopment #CodingJourney #DeveloperCommunity #100DaysOfCode #LearnToCode #JSFunctions #FrontendDeveloper #CodeWithYagsy #JavaScriptLearning
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 num = 12345; let reverse = Number(num.toString().split("").reverse().join("")); console.log(reverse);