Week 1: Learning JavaScript This week I picked up "Eloquent JavaScript" by Marijn Haverbeke. It helped me move beyond just writing code to understanding the language on a deeper level. Whether you are a programmer trying to learn JS or just "Vibe coding" understanding the quirks of the language is invaluable. 🚀 I’ve condensed my reading notes into this cheat sheet. Here is what is covered inside: 1️⃣ Data Types: The 7 primitives vs. objects, and quirks like why typeof null is "object". 2️⃣ Coercion: Why "5" + 3 gives you "53", but "5" - 3 gives you 2. 3️⃣ Modern Syntax: Arrow Functions, Destructuring, and the Spread operator. 4️⃣ Async Programming: The evolution from Callbacks to Promises to Async/Await. 5️⃣ The DOM & HTTP: How JS actually interacts with the web. I created this to share the lessons I learned along the way. Hope it helps you build a better foundation! What are you learning and doing this new year, comment down below 👇🏻 Next week I will be posting about React! #JavaScript #CodingJourney #SoftwareEngineering (P.S. link to the book -> https://lnkd.in/eqKeJHSU, Image & code inspired by the book. The robot was inspired by "automating the boring stuff with python" ->https://lnkd.in/eQVZ5qyk)
Learning JavaScript with Eloquent JavaScript by Marijn Haverbeke
More Relevant Posts
-
🚀 Day 7 (Part2) of Learning in Public: JavaScript Edition. 💻✨ --Higher Order Functions in JavaScript-- Following up on the theory, today I moved to implementation. I wanted to see exactly how JavaScript treats functions as "First-Class Citizens" in actual code. I built a modular calculator to test three core capabilities of Higher Order Functions: 1️⃣ Passing a Function as a Parameter (The Callback Pattern) Instead of hardcoding the logic inside the calculator, I passed operation itself (like divide or sum) as an argument. // A Higher-Order Function that 'consumes' another function function calculate(a, b, fun){ return fun(a, b); } // Logic is passed as a variable! let result = calculate(3, 3, divide); console.log(result); 2️⃣ Returning a Function from a Function. This concept is rare in my Java background but powerful in JS. I created a function check that doesn't return a value, but returns a whole new function to be executed later. // Returning a function function check(){ return function sum(a, b) { return a + b } } let checkResult = check(); // 'checkResult' is now a function console.log(checkResult(4, 5)); // Executing the returned function 3️⃣ Variable Assignment Throughout the practice, I used different syntaxes (Arrow Functions vs. Function Declarations) to assign these behaviors to variables, making the code much more concise. #JavaScript #CodingJourney #LearningInPublic #TechCommunity #NodeJS #TestAutomation #JavaVsJS #SDET
To view or add a comment, sign in
-
-
🚀 Day 10: of Learning in Public: JavaScript Edition. 💻✨ --String Manipulation -Part2 in JavaScript 🧵-- Here's what I learned: ✅ substring() - Works only with positive indices Example: "Piyush Saxena".substring(7, 9) → "Sa" ✅ slice() - The more powerful cousin that supports negative indices Example: "Piyush Saxena".slice(-3, -1) → "en" Extract from end: "Piyush Saxena".slice(-3) → "ena" The Edge Case That Broke My Brain: When I tried slice(-3, 0), it returned an empty string! Spent 15 minutes debugging this. Why? Because slice() always extracts left-to-right. With negative start (-3) and zero end (0), there's nothing to extract since the start comes "after" the end in extraction order. Key takeaway: When using negative indices, stick with negative for both parameters, or skip the end index entirely. ✅ split() - My new favorite for parsing strings! Space delimiter: "My name is Piyush Saxena".split(" ") → ["My", "name", "is", "Piyush", "Saxena"] (5 elements) Comma delimiter: "My name is Piyush Saxena, I am learning JS".split(",") → 2 elements No more manual character iteration for word counting! JavaScript keeps surprising me with these little details. Every day is a new learning adventure! #JavaScript #CodingJourney #LearningInPublic #TechCommunity #NodeJS #TestAutomation #JavaVsJS #SDET
To view or add a comment, sign in
-
-
🚀 Day 13 of Learning in Public: JavaScript Edition 💻✨ --Arrays-- Today I leveled up my JavaScript skills by mastering Array Methods and Functional Programming! 🔹 What I Learned: - The evolution from for...of loops → forEach() → map() → filter() → reduce() - How to write cleaner, more declarative code using arrow functions - The hidden arguments in forEach: current value, index, and original array - When to use each array method for maximum impact 🔹 Key Takeaways: ✅ forEach() - for side effects (logging, DOM updates) ✅ map() - for transforming data into new arrays ✅ filter() - for selecting elements that meet criteria ✅ reduce() - for accumulating values into a single result 🔹 Real-World Example: I built a transaction tracker that processes credit/debit amounts, and then took it further with method chaining: ```javascript const fullName = "Piyush Saxena" const initials = fullName .split(" ") .map(word => word.toLowerCase().at(0)) .join("") // Output: "ps" ✨ ``` The power of functional programming is that I'm now focusing on WHAT to do with the data, not HOW to loop through it. The code is more readable, maintainable, and expressive. 💡 Big Insight: Using the right array method for the job makes code self-documenting. When I see `.filter()`, I immediately know we're selecting items. With `.map()`, I know we're transforming data. 📈 What's Next: Tomorrow I'll dive deeper into reduce() for complex data transformations and explore method chaining patterns! 👉 What's your favorite JavaScript array method and why? #JavaScript #CodingJourney #LearningInPublic #TechCommunity #NodeJS #TestAutomation #JavaVsJS #SDET
To view or add a comment, sign in
-
-
This is a great update to share! The introduction of the if() function is a significant milestone because it brings CSS closer to the "logic" we usually see in languages like JavaScript or Python, without losing its declarative nature. To make your post more engaging and clear for your audience, I’ve restructured it to highlight the "Why it matters" and provided a clear code comparison. 🚀 Is CSS Becoming a Programming Language? Not exactly—but it’s getting a major "brain" upgrade! Traditionally, logic in CSS (like media queries) requires jumping between different blocks of code. It works, but it can feel fragmented and repetitive. That’s about to change with the new CSS if() function. 💡 What’s changing? The if() function allows you to write inline conditional logic. Instead of writing an entire media query block to change one value, you can handle it directly inside the property declaration. #programing #css #coding #Csslanguage
To view or add a comment, sign in
-
-
Day-75 📘 Python Full Stack Journey – JavaScript String Methods Today I continued learning JavaScript and focused on one of the most commonly used areas — String methods. These methods are extremely useful for text processing, validation, and UI logic. ✍️💻 🎯 What I learned today: 🔹 length — to find the length of a string 🔹 replace() and replaceAll() — to modify text content 🔹 split() — to break strings into arrays 🔹 indexOf() — to find the position of a substring 🔹 slice() — to extract parts of a string 🔹 trim() — to remove extra spaces 🔹 startsWith() and endsWith() — to check string boundaries 🔹 toUpperCase() and toLowerCase() — to change letter cases 🔹 includes() — to check if a substring exists 🔹 search() — to search using patterns Practicing these methods helped me understand how JavaScript handles text and how powerful string manipulation can be in real-world applications like form validation and data handling. Excited to keep learning and building dynamic web features! 🚀 #JavaScript #PythonFullStack #WebDevelopment #Frontend #CodingJourney #LearningToCode #Upskilling #TechSkills #ContinuousLearning
To view or add a comment, sign in
-
-
New to JavaScript? Discover the power of the Math object with simple, hands-on examples. Learn how to round numbers, pick random values, and more—click to start coding!
To view or add a comment, sign in
-
🚀 Day 16 of JavaScript Learning – Advanced Array Methods & Timing Functions Today I explored some powerful JavaScript concepts that are essential for writing clean and efficient code: 🔹 Advanced Array Methods map() – transform array elements filter() – extract data based on conditions reduce() – aggregate values into a single result 🔹 JavaScript Timing Functions setTimeout() – execute code after a delay setInterval() – run code repeatedly at intervals clearTimeout() – stop a scheduled timeout clearInterval() – stop repeated execution These concepts helped me better understand data transformation, performance optimization, and asynchronous behavior in JavaScript. 💡 Consistent learning, one day at a time 💪 #JavaScript #WebDevelopment #FrontendDevelopment #LearningJourney #Coding #100DaysOfCode #JavaScriptBasics #Programming
To view or add a comment, sign in
-
JavaScript math can be pretty wild. So, you've probably stumbled upon those tutorials that claim JavaScript math is, well, weird - and they're not entirely wrong. I mean, have you ever tried adding 0. and 0.2 in your console? It's like, what's going on? The result is this tiny, seemingly insignificant number: 0.00000004. Yeah, it's a real head-scratcher. It's simple. JavaScript stores numbers as floating-point values - that's just how it works. It uses the IEEE 754 floating-point representation, which is a system that has a fixed number of bits to store values. Now, here's the thing: some decimal values are infinitely repeating and non-terminating in binary - like , for instance. In binary, is represented as.000110011... and it just keeps going. Since this sequence repeats forever, it gets rounded off, so 0.1 isn't stored as exactly 0.1, but as a value slightly above it. Same thing with . So, when you add 0.1 and 0.2, you don't get exactly 0.3. It's not just JavaScript, though - other languages like Python, Java, and C++ have the same issue. They all use floating-point representation, but they often round values when printing them, which can make the problem less noticeable. JavaScript, on the other hand, shows you the raw result, which can make it seem like its math is weird, but really, it's just being honest. It's all about perspective. And, honestly, it's not that big of a deal - you just need to understand how it works. It's like trying to explain a complex concept, like a mathematical equation, in a simple way - sometimes you need to use analogies or metaphors to get the point across. Anyway, that's JavaScript math in a nutshell. Source: https://lnkd.in/gqWasR3b #JavaScript #Math #Programming
To view or add a comment, sign in
-
Turning concepts into working code is the best way to learn. So I built a frontend web application using HTML, CSS, and JavaScript, along with a dummy Python backend server to simulate real backend behavior. What I learned from this project: - DOM manipulation and event handling - Structuring frontend code - How frontend communicates with backend - Handling basic requests using Python This project helped me understand how individual technologies come together to form a complete web application. I’m planning to extend this further using real APIs and databases. I’d really appreciate feedback and suggestions from the community. Tech Stack: HTML | CSS | JavaScript | Python #WebDevelopment #FrontendDeveloper #JavaScriptProjects #PythonLearning #BTechStudent #LearningByBuilding
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
Object destructing probably one of my favorite things about the language.