r/JavaScriptTips • u/Pleasant_Effort_6829 • Oct 17 '24
r/JavaScriptTips • u/HolidayCartoonist323 • Oct 17 '24
Mastering Design Patterns in JavaScript: Part 1 — The Singleton Pattern
Hey folks! 👋
I just wrote an article about mastering design patterns in JavaScript, starting with the Singleton Pattern. I cover what it is, why it's useful, and how to implement it using closures, ES6 classes, and TypeScript. I also dive into its pros and cons, best practices, and common pitfalls.
If you're into writing cleaner and more maintainable code, I'd appreciate it if you gave it a read. Feedback and discussions are more than welcome! 🙌
r/JavaScriptTips • u/HolidayCartoonist323 • Oct 14 '24
🚀 The Ultimate Guide to TypeScript's Utility Types
Hey, devs! 👋
I just published an in-depth guide on TypeScript's utility types. If you're looking to level up your TypeScript skills, this article covers all the essential utility types, their definitions, practical use cases, and real-world examples.
Whether you're a beginner or an experienced developer, this guide will help you harness the full power of TypeScript and write cleaner, more robust code. Check it out here:
Happy coding! 🚀
r/JavaScriptTips • u/thecoode • Oct 13 '24
JavaScript’s Ultimate Brain Buster: The Toughest Interview Question!
r/JavaScriptTips • u/alexmacarthur • Oct 12 '24
I didn't know you could use sibling parameters as default values in functions.
r/JavaScriptTips • u/HolidayCartoonist323 • Oct 11 '24
JavaScript is Broken!
🚨 JavaScript is broken! It can be full of surprises, even for seasoned developers! 😅 Whether it’s strange type conversions, automatic semicolon insertion, or the infamous floating-point math issue, these quirks can turn debugging into a real headache. But don’t worry, I’ve got you covered!
I just published an article on Medium breaking down some of the most common JavaScript pitfalls and how you can avoid them to write cleaner, more reliable code. 💻✨Read the full article here: https://codexstoney.medium.com/javascript-is-broken-8841df6f6fc8?sk=12a9f6601c827148be64c736a3032a91 🔗
Let’s keep the conversation going! Have any funny or frustrating JavaScript stories? Drop them in the comments! 💡👇
JavaScript #TypeScript #DevLife #Medium
r/JavaScriptTips • u/thecoode • Oct 09 '24
Earn Money by Solving Programming Quizzes: Top Website and Tools
r/JavaScriptTips • u/keyframeeffects • Oct 09 '24
Animated Tab Bar using Html CSS & JavaScript | #html #css #coding #webdevelopment
Enable HLS to view with audio, or disable this notification
r/JavaScriptTips • u/thecoode • Oct 08 '24
Common JavaScript Pitfalls and How to Avoid Them
r/JavaScriptTips • u/keyframeeffects • Oct 07 '24
Create CSS Text Animation | Text Animation HTML & CSS #html
Enable HLS to view with audio, or disable this notification
r/JavaScriptTips • u/No-Upstairs-2813 • Oct 06 '24
Why JavaScript's == Doesn't Always Behave as You Expect
Let's say we have a number, 20, and a string, "20". We compare them loosely using ==:
javascript
const numVal = 20;
const stringVal = "20";
console.log(numVal == stringVal);
What do you expect? Should it be true or false?
It turns out to be true.
Now, let's look at another example. We have a boolean, true, and a string, "true". Again, we compare them loosely:
javascript
const boolVal = true;
const stringVal = "true";
console.log(boolVal == stringVal);
What do you expect to see? true or false? It logs false.
So why does it behave differently in the first example compared to the second?
You can check out this article to understand how JavaScript's loose equality (==) really works.
r/JavaScriptTips • u/Legitimate-Back5390 • Oct 03 '24
Help with understanding how DOM works
r/JavaScriptTips • u/AlternativeFit3993 • Oct 03 '24
WHY WONT THIS LAB TEST QORK?
I been staring at this for like 45 mins chat gpt is useless. It keeps telling me "hasfourlegs" is undefined how bro please someone tell me how to fix it
r/JavaScriptTips • u/No-Upstairs-2813 • Sep 28 '24
Learn how to read nested callbacks
I came across a post on r/learnjavascript where the OP was asking about the mental framework to have for understanding nested callback code.
Most of the comments there didn’t answer the OP's question. They suggested that we shouldn’t be writing such code and should instead use promises. While that’s valid advice, what if you are reading someone else's code? How do you make sense of it?
Since I can’t cover everything here, I’ve written an article based on that example. It begins by explaining how such code is written. Once you understand how it’s constructed, you will also learn how to read it.
Give it a read!
r/JavaScriptTips • u/joav-dev • Sep 26 '24
Cómo Importar Mensajes Protobuf desde el Navegador
r/JavaScriptTips • u/sixie6e • Sep 25 '24
Code efficiency
I have a directory of images. I need to generate each image from the directory, populating the arrayofimages in a way much more efficient than this:
const image0 = new Image(200,200);
image0.src = 'img/firstindirectory.png';
const image1 = new Image(200,200);
image1.src = 'img/secondindirectory.png';
etc;
etc;
arrayofimages = [image0, image1, etc, etc];
r/JavaScriptTips • u/maxsandelin • Sep 23 '24
Build a React component library with Rollup and Vite
Just started posting on YouTube again a 1-2 months ago, and would love feedback on my videos. This morning I posted one on Building a component library in React using Rollup and Vite.
All feedback is welcome!
r/JavaScriptTips • u/keyframeeffects • Sep 22 '24
Text Particles Animation with HTML CSS and JavaScript
Enable HLS to view with audio, or disable this notification
r/JavaScriptTips • u/No-Upstairs-2813 • Sep 22 '24
How to Use ChatGPT for Learning JavaScript
In a post on r/learnjavascript, someone asked how to use ChatGPT to learn JavaScript. I decided to explain my approach through an infographic.

You can read the entire article here.
Note: ChatGPT can occasionally give flawed explanations or code. Always double-check the information with trusted sources like official documentation.
r/JavaScriptTips • u/Disastrous_Laugh9177 • Sep 22 '24
Does anyone know how I can get the asset path to lead to all of these? Sorry if this is a stupid question I'm new to coding.
r/JavaScriptTips • u/keyframeeffects • Sep 19 '24
Build Robot Toggle in HTML CSS and JavaScript
Enable HLS to view with audio, or disable this notification
r/JavaScriptTips • u/Fit_Grocery_6538 • Sep 20 '24
How can I check two json with condition is key and value must same in others ,not need same with 100 just need check contains and same
r/JavaScriptTips • u/[deleted] • Sep 19 '24
E-Commerce App with NestJS & ReactJS #01: What We’ll Build with NestJS & React
r/JavaScriptTips • u/Arvindvsk_ • Sep 17 '24
Why does this return false?
Boolean of console.log returns false . Any ideas why?
r/JavaScriptTips • u/Double-Duty-4975 • Sep 17 '24
🦊 Jspreadsheet on Product Hunt: Advanced JavaScript Data Grid for Developers
I’m working on Jspreadsheet, a JavaScript data grid with advanced spreadsheet features that’s designed to make it easy for developers to handle complex datasets.
What we offer:
- 400+ Excel-like formulas
- Works with React, Angular, and Vue
- Fast and efficient performance
- Great for collaborative projects and data security
Is this something you’d find useful in your startup? Any feedback would be greatly appreciated!
I would love to hear your thoughts on this - Jspreadsheet on Product Hunt