Craig's public fiddles
-
jQuery addClass example
Change class name on click in jQuery
-
Promise
Quick example of a promise
-
zhvq6ef0
No-Library (pure JS), HTML, CSS, JavaScript
-
Palindrome
No-Library (pure JS), HTML, CSS, JavaScript
-
JS Reference vs Value
No-Library (pure JS), HTML, CSS, JavaScript
-
Javascript Arrays
No-Library (pure JS), HTML, CSS, JavaScript
-
xqj80f7d
No-Library (pure JS), HTML, CSS, JavaScript
-
un0e7xjr
No-Library (pure JS), HTML, CSS, JavaScript
-
Module Pattern
In JavaScript, the Module pattern is used to further emulate the concept of classes in such a way that we're able to include both public/private methods and variables inside a single object, thus shielding particular parts from the global scope.
-
Puzzle Game
CreateJS 2013.09.25, HTML, CSS, JavaScript
-
Puzzle Game
CreateJS 2013.09.25, HTML, CSS, JavaScript
-
Anonymous Closures
Sensitive data is private by closure, and our public properties are accessible through the namespace.
-
Exception Errors
Controlling program flow after run-time errors
-
Speed Test Class
No-Library (pure JS), HTML, CSS, JavaScript
-
Loop Optimisation
Store object lengths in a variable in the for-loop for good optimisation. This will greatly reduce the overhead on calls made.
-
Fall Through
A carefully organised switch block can add LEAST common properties first and MOST common, last.
-
Logical Assignment && ||
No-Library (pure JS), HTML, CSS, JavaScript
-
Singleton
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.
-
Assigning results of Ternaries
Since the ternary condition always returns a result we can assign it!
-
Prototypes
There are various ways for using prototype. You can override the existing prototype or append to the existing prototype