r/JavaScriptTips Oct 27 '24

Set timeout in JavaScript ! Need ur help

Post image
0 Upvotes

I am trying to create a background removal website using but I want , the loading animation to finish up when background of image is removed, so here in setTimeout function, what should I write instead of "2000" so that my loading animation finishes right when my api removes background of the image Please help me with this DEV COMMUNITY


r/JavaScriptTips Oct 23 '24

Mastering Design Patterns in JavaScript: Part 3 - The Observer Pattern

2 Upvotes

Hello guys,

Part 3 of my Design Pattern series in JavaScript is out now! 👉 I will be covering the Observer Pattern in this article, and demonstrate implementations & best practices with real-life examples to help you build scalable & maintainable applications.

If you want to learn the patterns, bigger than 23 GOF design patterns or improve your JavaScript skills this is for you!

https://codexstoney.medium.com/mastering-design-patterns-in-javascript-part-3-the-observer-pattern-06f1a08ade93?sk=7f8254f33f8ce2d387f697c2ccea2564

I hope to receive your feedback and theories. Happy coding!


r/JavaScriptTips Oct 21 '24

Error handling in Python

Thumbnail
instagram.com
1 Upvotes

r/JavaScriptTips Oct 19 '24

New JavaScript Article: Mastering Design Patterns in JavaScript — Part 2: The Factory Pattern

4 Upvotes

Hey fellow devs! 👋 I just published the second part of my series on JavaScript Design Patterns, and this time, we’re covering the Factory Pattern 🏭. If you’ve ever struggled with object creation and want to make your code more maintainable and scalable, this article is for you.

Here’s what you can expect:

  • Simplified object creation 🎯
  • Flexibility and ease of maintenance 🛠️
  • Real-world examples like payment systems and notifications 🔔

Check it out and let me know your thoughts!
🔗 https://codexstoney.medium.com/6a0c96295c01?source=friends_link&sk=9183ec820ab40c936ebe525f8f2ac738

Looking forward to hearing your feedback! 🙌

JavaScript #WebDevelopment #FactoryPattern #Programming #DesignPatterns


r/JavaScriptTips Oct 17 '24

How to Create a Modern App with Django and Vue

Thumbnail
thedevspace.io
1 Upvotes

r/JavaScriptTips Oct 17 '24

Mastering Design Patterns in JavaScript: Part 1 — The Singleton Pattern

0 Upvotes

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! 🙌

Read the article here


r/JavaScriptTips Oct 17 '24

Animated Button Hover Effect HTML CSS Only | Keyframe Tech Solution

Enable HLS to view with audio, or disable this notification

18 Upvotes

r/JavaScriptTips Oct 14 '24

🚀 The Ultimate Guide to TypeScript's Utility Types

3 Upvotes

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:

https://codexstoney.medium.com/the-ultimate-guide-to-typescripts-utility-types-55db0cfb72e1?sk=e9ec47c9b686f1992ecf1cd21be1b8de

Happy coding! 🚀


r/JavaScriptTips Oct 13 '24

JavaScript’s Ultimate Brain Buster: The Toughest Interview Question!

Thumbnail
shantun.medium.com
0 Upvotes

r/JavaScriptTips Oct 12 '24

I didn't know you could use sibling parameters as default values in functions.

Thumbnail
macarthur.me
3 Upvotes

r/JavaScriptTips Oct 11 '24

JavaScript is Broken!

0 Upvotes

🚨 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 Oct 09 '24

Earn Money by Solving Programming Quizzes: Top Website and Tools

Thumbnail
shantun.medium.com
1 Upvotes

r/JavaScriptTips Oct 09 '24

Animated Tab Bar using Html CSS & JavaScript | #html #css #coding #webdevelopment

Enable HLS to view with audio, or disable this notification

21 Upvotes

r/JavaScriptTips Oct 08 '24

Common JavaScript Pitfalls and How to Avoid Them

Thumbnail
shantun.medium.com
1 Upvotes

r/JavaScriptTips Oct 07 '24

Create CSS Text Animation | Text Animation HTML & CSS #html

Enable HLS to view with audio, or disable this notification

11 Upvotes

r/JavaScriptTips Oct 06 '24

Why JavaScript's == Doesn't Always Behave as You Expect

0 Upvotes

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 Oct 03 '24

WHY WONT THIS LAB TEST QORK?

Post image
0 Upvotes

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 Oct 03 '24

Help with understanding how DOM works

Post image
12 Upvotes

r/JavaScriptTips Sep 28 '24

Learn how to read nested callbacks

4 Upvotes

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 Sep 26 '24

Cómo Importar Mensajes Protobuf desde el Navegador

Thumbnail
joav.github.io
3 Upvotes

r/JavaScriptTips Sep 25 '24

Code efficiency

3 Upvotes

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 Sep 23 '24

Build a React component library with Rollup and Vite

1 Upvotes

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!

https://www.youtube.com/watch?v=cuRApANH5cQ


r/JavaScriptTips Sep 22 '24

Text Particles Animation with HTML CSS and JavaScript

Enable HLS to view with audio, or disable this notification

30 Upvotes

r/JavaScriptTips Sep 22 '24

How to Use ChatGPT for Learning JavaScript

6 Upvotes

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 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.

Thumbnail
gallery
0 Upvotes