Singleton Design Pattern - Beau teaches JavaScript

preview_player
Показать описание
The Singleton Design pattern limits the number of instances of a particular object to just one. Find out how to implement this in JavaScript.

Code

Other resources on topic:

-
⭐JavaScript Playlists⭐

-
We're busy people who learn to code, then practice by building projects for nonprofits. Learn Full-stack JavaScript, build a portfolio, and get great references with our open source community.

Рекомендации по теме
Комментарии
Автор

This explanation is gold! I really like the fact that a randomly generated number is used to detect whether the singleton has been created or not.

ilovelctr
Автор

Boom! Definition straight out the gate . No BS . I already like you ... Continuing video...

fordfiveohh
Автор

I have read a lot of articles about this in hopes of understanding it clearly but this video sums it all up. Straight to the point! Thanks for this!

kennethkim
Автор

Crystal clear & straightforward example. Like it!

gan
Автор

I was hoping to find an NPM module that implements all of this for a generic JSON data structure. But I guess implementing all of this internally to a project from first principals is probably a bit more flexible and powerful for the individual needs of a project / developer. Nice thank you for sharing!! :-D

SethEden
Автор

Perfect. I like it. Thank you so much (y)

monkeyluffy
Автор

Singleton pattern in JavaScript is completely useless. Javascript uses the prototype pattern, with that in mind you can just create an Object (JUST AN OBJECT) and use it like a singleton class. One instance, no "new", no classes, less code, easier implementation!

NikosKeyZ
Автор

This example is absolutely useless. I still have no clue how to use singleton in real life and why I want to use it. The code is taken out of empty space. Why couldn't you give some real life example?

forjacob
Автор

dislike for flashing a giant jquery logo in my face in front of my jquery hating coworkers.

danielcrain
Автор

It's quite funny that I came to Youtube because I didn't get Addy Osmani's explanation and then I clicked one of the top results, it turns out to be a plagiarism of his Singleton Pattern section in Learning JavaScript Design Patterns.

paterfamiliasgeminusiv