7 kyu
Singleton Pattern
8,105 of 8,200hculap
Description:
In software engineering, the singleton pattern is a design pattern that restricts the instantiation of a class to one object. This is useful when exactly one object is needed to coordinate actions across the system.
Create an Singleton pattern, so there is one object in system.
Example:
var obj1 = new Singleton();
var obj2 = new Singleton();
obj1 === obj2; // => true
obj1.test = 1;
obj2.test; // => 1
Singleton
Object-oriented Programming
Fundamentals
Similar Kata:
Stats:
Created | Apr 17, 2014 |
Published | Apr 17, 2014 |
Warriors Trained | 13944 |
Total Skips | 1397 |
Total Code Submissions | 49500 |
Total Times Completed | 8200 |
JavaScript Completions | 8105 |
CoffeeScript Completions | 113 |
Total Stars | 175 |
% of votes with a positive feedback rating | 79% of 299 |
Total "Very Satisfied" Votes | 203 |
Total "Somewhat Satisfied" Votes | 68 |
Total "Not Satisfied" Votes | 28 |