✨ 𝗗𝗮𝘆 𝟱 𝗼𝗳 𝗠𝘆 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗝𝗼𝘂𝗿𝗻𝗲𝘆 🚀 Today I explored 𝗡𝘂𝗺𝗯𝗲𝗿𝘀 𝗮𝗻𝗱 𝘁𝗵𝗲 𝗠𝗮𝘁𝗵 𝗢𝗯𝗷𝗲𝗰𝘁 in JavaScript, and learned some interesting behind-the-scenes details: • 𝗡𝘂𝗺𝗯𝗲𝗿 – integers, floats, NaN, Infinity • 𝗠𝗮𝘁𝗵 𝗢𝗯𝗷𝗲𝗰𝘁 – handy methods like Math.round(), Math.floor(), Math.ceil(), Math.random(), Math.max(), Math.min() • 𝗠𝗮𝘁𝗵.𝗿𝗮𝗻𝗱𝗼𝗺() – generates pseudo-random numbers, which means it’s not truly random. It’s predictable if you know the algorithm and therefore shouldn’t be used for OTPs or secure codes. It’s fascinating to see how much thought goes into even simple math operations in JavaScript. Step by step, my fundamentals are getting stronger! 💪 #JavaScript #100DaysOfCode #WebDevelopment #LearningJourney #FrontendDevelopment #CodingTips
Exploring JavaScript Math Functions
More Relevant Posts
-
𝗜𝗳 𝘆𝗼𝘂 𝗰𝗮𝗻’𝘁 𝘀𝗼𝗹𝘃𝗲 𝘁𝗵𝗲 “𝘁𝗵𝗶𝘀” 𝗽𝗿𝗼𝗯𝗹𝗲𝗺 𝗶𝗻 𝘁𝗵𝗲 𝗶𝗺𝗮𝗴𝗲… 𝘆𝗼𝘂 𝘀𝗵𝗼𝘂𝗹𝗱 𝗿𝗲𝗮𝗱 𝘁𝗵𝗶𝘀 𝗮𝗿𝘁𝗶𝗰𝗹𝗲. I recently went deep into one of the most confusing topics in JavaScript: this. At first it feels random… but once you understand the rules, it actually becomes predictable. Here’s what I explored while writing the article: • 𝗛𝗼𝘄 this 𝗶𝘀 𝗱𝗲𝘁𝗲𝗿𝗺𝗶𝗻𝗲𝗱 𝗯𝘆 𝘁𝗵𝗲 call-site rule • Why nested functions often break the expected this context • How arrow functions solve the nested this problem with lexical binding • When to use call() to explicitly set this • How apply() works • Why bind() is useful for permanently binding context The biggest realization for me: 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗱𝗼𝗲𝘀𝗻’𝘁 𝗰𝗮𝗿𝗲 𝘄𝗵𝗲𝗿𝗲 𝗮 𝗳𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗶𝘀 𝘄𝗿𝗶𝘁𝘁𝗲𝗻. 𝗜𝘁 𝗼𝗻𝗹𝘆 𝗰𝗮𝗿𝗲𝘀 𝗵𝗼𝘄 𝗶𝘁’𝘀 𝗰𝗮𝗹𝗹𝗲𝗱. That one idea clears up a lot of confusion around this. If the image problem makes you pause for a second… the article will make it click. 💡 Article Link - https://lnkd.in/gRDMurrQ Also grateful to the amazing educators who simplify tough concepts: Hitesh Choudhary sir, Piyush Garg sir, and the Chai Aur Code team. #javascript #webdevelopment #learninpublic #frontenddevelopment #programming #codingjourney #devcommunity #chaicode
To view or add a comment, sign in
-
-
I just published a new blog post: "Understanding Objects in JavaScript" ✍️ Objects are one of the most fundamental parts of JS, allowing us to store complex data in structured key-value pairs. In this guide, I cover: What objects are and why we need them. Creating and accessing object properties. Updating, adding, and deleting data within objects. A huge thank you to Hitesh Choudhary sir and the Chai aur Code team for making these crucial concepts so clear and easy to follow. Read the full article here: 🔗 https://lnkd.in/eRDiPNWW #JavaScript #WebDevelopment #ChaiAurCode #LearningJourney #Coding #Hashnode
To view or add a comment, sign in
-
-
Building on the basics of JavaScript, I’ve gained a solid understanding of how core components build a functional system. Writing code is the heart of this process, and seeing these concepts integrate is a major highlight of my learning. I have been practicing variable assignments using let, const, and var, while using typeof to identify different data types. I also learnt how to structure Control Flow through if/else statements, switch cases, and comparison operators. By using logical operators—specifically AND (&&) and OR (||)—along with strict equality (===), I can now set multiple rules for my code. I understand how to ensure that if a primary condition isn't met, the "else" logic applies correctly so the program follows a specific path. I also learnt how to use for loops combined with the .length property. This allows the code to automatically track the number of characters or items in a dataset. Instead of hard-coding values, I can now write dynamic code that adjusts to the data it receives. I am still working through the fundamentals, and I am excited to see how everything will work together once the foundation is complete! #JavaScript #WebDevelopment #CodingJourney #SoftwareEngineering #Techcrush #Frontend
To view or add a comment, sign in
-
-
Just published a new blog on Control Flow in JavaScript — titled “𝗗𝗘𝗖𝗜𝗦𝗜𝗢𝗡𝗦.” When I started this JS series, I told myself I’d keep it 𝘀𝗶𝗺𝗽𝗹𝗲 𝗮𝗻𝗱 𝗰𝗹𝗲𝗮𝗿. One concept at a time. So far the series looks like this: 𝟬𝟭 – 𝗝𝗦 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲𝘀 𝟬𝟮 – 𝗢𝗽𝗲𝗿𝗮𝘁𝗼𝗿𝘀 𝗣𝗿𝗼𝗺𝗶𝘀𝗲𝘀 (𝘄𝗶𝗹𝗱 𝗰𝗮𝗿𝗱) 𝟬𝟯 – 𝗗𝗲𝗰𝗶𝘀𝗶𝗼𝗻𝘀 (𝗖𝗼𝗻𝘁𝗿𝗼𝗹 𝗙𝗹𝗼𝘄) It’s interesting how programming really comes down to this.. 𝘴𝘵𝘰𝘳𝘦 𝘥𝘢𝘵𝘢 → 𝘰𝘱𝘦𝘳𝘢𝘵𝘦 𝘰𝘯 𝘪𝘵 → 𝘥𝘦𝘤𝘪𝘥𝘦 𝘸𝘩𝘢𝘵 𝘩𝘢𝘱𝘱𝘦𝘯𝘴 𝘯𝘦𝘹𝘵. That’s what this post focuses on. Also… yes, I’ve been using scorpions in the thumbnails lately. No deep philosophy behind it. I just like how they look. If you're learning JavaScript or revising fundamentals, you might find it useful. 🔗 https://lnkd.in/gR6HsW5E Feedback is always welcome. #JavaScript #WebDevelopment #LearningInPublic
To view or add a comment, sign in
-
-
Continuing my journey into JavaScript, I’ve just published a new blog post! This time, I’m breaking down JavaScript Operators—the fundamental building blocks that allow us to manipulate data and build logic in our code. In this guide, I cover: ✅ Arithmetic Operators (+, -, *, /, %) – The math behind the logic. ✅ Comparison Operators (==, ===, !=, >, <) – Understanding how to evaluate conditions . ✅ Strict Equality (===) – Why type checking matters! ✅ Logical & Assignment Operators (&&, ||, !, =, +=) – Flow control and data handling. I’ve included plenty of practical examples to make these concepts stick for good. A big shoutout once again to Hitesh Choudhary sir for the incredible guidance in making these basics so clear and easy to understand. Check out the full guide here: https://lnkd.in/e7s4tANn Akash Kadlag | Jay Kadlag | #JavaScript #CodingBasics #WebDevelopment #Programming #Hashnode #TechCommunity #LearnToCode #chaiaurcode
To view or add a comment, sign in
-
-
𝗛𝗮𝘃𝗲 𝘆𝗼𝘂 𝗲𝘃𝗲𝗿 𝘀𝘁𝗼𝗽𝗽𝗲𝗱 𝗮𝗻𝗱 𝗮𝘀𝗸 𝘆𝗼𝘂𝗿𝘀𝗲𝗹𝗳 𝘄𝗵𝘆 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 𝗶𝘀 𝗽𝗮𝘀𝘀 𝗯𝘆 𝘃𝗮𝗹𝘂𝗲, 𝗮𝗻𝗱 𝗻𝗼𝘁 𝗽𝗮𝘀𝘀 𝗯𝘆 𝗥𝗲𝗳𝗲𝗿𝗲𝗻𝗰𝗲?🤔 You see... when a value is passed into a function in JS, the function receives a copy of that value, not ❌direct access to the original variable. This means a function cannot reassign the caller’s variable or take ownership of it. For primitive values like (numbers, strings, booleans...), the copied value is independent, so changes inside the function do not affect the original value. (e.g reassigning) For objects and arrays(non-primitives), the copied value happens to be a reference (memory address) to the same object. So, mutating the object inside the function affects the original object but reassigning the reference does not! 🚫 so... JavaScript always passes values, but for objects, the value being passed is a reference ✅✅. If you understand this, it will surely save you from debugging headaches 🧑💻🧑💻 . . . . . #JavaScript #CodingTips #WebDevelopment #Programming #LearnToCode #CodeNewbie #SoftwareEngineering #DevTips #TechCommunity
To view or add a comment, sign in
-
-
🚦 𝐋𝐞𝐭’𝐬 𝐚𝐝𝐝 𝐬𝐨𝐦𝐞 𝐥𝐨𝐠𝐢𝐜 𝐭𝐨 𝐭𝐡𝐚𝐭 𝐜𝐨𝐝𝐞! I’m excited to share the 3rd blog of my "JavaScript Essentials 101" series. After covering variables, data types and operators, it's time to learn how to guide your code through different paths. This time, we are diving deep into 𝐂𝐨𝐧𝐭𝐫𝐨𝐥 𝐅𝐥𝐨𝐰: 𝐈𝐟, 𝐄𝐥𝐬𝐞, 𝐚𝐧𝐝 𝐒𝐰𝐢𝐭𝐜𝐡. In my blog post, I breakdown exactly how JavaScript processes logic, using beginner-friendly examples that actually make sense. 𝐇𝐞𝐫𝐞 𝐢𝐬 𝐰𝐡𝐚𝐭 𝐰𝐞 𝐜𝐨𝐯𝐞𝐫: ✅ 𝐓𝐡𝐞 "𝐓𝐫𝐚𝐟𝐟𝐢𝐜 𝐑𝐮𝐥𝐞𝐬" 𝐨𝐟 𝐂𝐨𝐝𝐞: A simplified definition of what control flow actually means. ✅ 𝐈𝐟, 𝐄𝐥𝐬𝐞, 𝐚𝐧𝐝 𝐭𝐡𝐞 𝐋𝐚𝐝𝐝𝐞𝐫: Master foundational decision-making (using conditions like checking voting age or grading marks). ✅ 𝐓𝐡𝐞 𝐒𝐰𝐢𝐭𝐜𝐡 𝐒𝐭𝐚𝐭𝐞𝐦𝐞𝐧𝐭: How to use multi-way branching for cleaner, more readable alternatives to long else if chains. ✅ 𝐓𝐡𝐞 𝐁𝐫𝐞𝐚𝐤𝐢𝐧𝐠 𝐏𝐨𝐢𝐧𝐭: Why the break keyword is crucial inside switch. ✅ 𝐓𝐡𝐞 𝐆𝐨𝐥𝐝𝐞𝐧 𝐑𝐮𝐥𝐞: A practical breakdown of exactly when to use switch vs. if-else. Mastering these conditional structures is what transforms a simple "coder" into an "application builder." Stop letting your code run sequentially and start making it intelligent! 𝐑𝐞𝐚𝐝 𝐭𝐡𝐞 𝐟𝐮𝐥𝐥, 𝐝𝐞𝐭𝐚𝐢𝐥𝐞𝐝 𝐠𝐮𝐢𝐝𝐞 𝐡𝐞𝐫𝐞: https://lnkd.in/ghpw9iPc Mentions: Hitesh Choudhary Piyush Garg Chai Aur Code Akash Kadlag Jay Kadlag Suraj Kumar Jha Nikhil Rathore #JavaScript #CodingTips #WebDevelopment #LearnToCode #Programming #CodeLogic #Hashnode #ChaiAurCode #ChaiCode
To view or add a comment, sign in
-
-
Remember this from math class? 𝘅 = 𝟱. 𝗙𝗶𝗻𝗱 𝘆. The moment we see this, we instantly assume: “𝘅 𝗵𝗼𝗹𝗱𝘀 𝘁𝗵𝗲 𝘃𝗮𝗹𝘂𝗲 𝟱.” Back then, variables mostly held numbers. Now here’s the interesting part… JavaScript didn’t stop at numbers. It introduced something called Data Types. Let’s simplify JavaScript Data Types ↓ Small differences. Big impact. 🚀 And this is just the beginning… Wait until you see what happens with "𝟱" + 𝟮 👀 Grateful to be learning and growing every day at Sheryians Coding School under the guidance of Harsh Vandana Sharma, Sarthak Sharma, and Ankur Prajapati. #JavaScript #WebDevelopment #Frontend #LearningJourney #LearnByAction #JS
To view or add a comment, sign in
-
I thought JavaScript arrays worked like C arrays… I was wrong. ❌ I believed: 👉 Arrays are stored in contiguous memory 👉 Indexing is just base + offset 👉 Everything sits neatly in one block But JavaScript doesn’t work like that. Here’s the real mental model 👇 ✅ The variable (arr) lives in the STACK ✅ It stores a reference (not the actual array) ✅ The actual array lives in the HEAP ✅ The array stores: • metadata (like length) • pointer to elements storage Now the interesting part: 👉 Elements can be: * primitives (numbers, booleans) * references (strings, objects) 👉 Strings/objects are usually stored separately in memory 👉 Arrays can be dynamic, sparse, and optimized internally ⚠️ Most important: JavaScript arrays are NOT guaranteed to be contiguous in memory. That means: They are closer to dynamic objects than low-level arrays. 💡 Actual storage depends on the JS engine (like V8), which heavily optimizes things under the hood. I made a diagram to simplify this 👇 Course Instructor: Rohit Negi | Youtube Channel: Coder Army #JavaScript #webdevelopment #buildinpublic #learninginpublic #fullstackdevelopment.
To view or add a comment, sign in
-
-
I just published a new blog post: "Understanding Variables and Data Types in JavaScript" ✍️ Every great application starts with the fundamentals. In this guide, I deep dive into: How variables act as containers for data. The differences between var, let, and const. Primitive data types and the concept of scope. A huge thank you to Hitesh Choudhary sir and the Chai Aur Code team for helping me build such a strong foundation in JS. Read the full article here: 🔗 https://lnkd.in/eEYXSV8a Piyush Garg | Akash Kadlag | Anirudh J. | Jay Kadlag | #JavaScript #WebDevelopment #ChaiAurCode #LearningJourney #Coding #Hashnode
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