UselessCode's public fiddles
-
Modifying a property of the parameter doesn't mutate what that parameter refers to
Expanding on what I meant in when I said "Modifying a property of the parameter doesn't mutate what that parameter refers to" in my SO answer here https://stackoverflow.com/a/42399879/778975
-
2zp1yqat
Created for answer to http://stackoverflow.com/questions/8132081/generate-a-random-seeded-hex-color
-
getComputedStyle, in Chrome, only works if nodes are attached to the DOM
Fork of http://jsfiddle.net/3wz4xdgq/3/
-
Using event delegation for a modal photo gallery
Created for answer to http://stackoverflow.com/questions/42081905/how-to-apply-the-same-function-to-multiple-ids showing how to use event delegation to cut down on both markup and code.
-
Fading headline marquee
Created for answer to http://stackoverflow.com/questions/39190545/how-do-i-enable-javascript-autoload-function
-
Changing placeholder text on dropdown change
Created for answer to http://stackoverflow.com/questions/38712913/search-box-label-should-change-by-drop-down-list
-
Creating DOM elements with a config object
Created for my answer to http://stackoverflow.com/questions/38672923/universal-function-to-create-children-elements-and-append-to-parent-nodes
-
null props to undefined
Part of answer for http://stackoverflow.com/questions/37559901/how-to-search-and-replace-value-in-array-of-object-literals
-
Cycling element positions
Created for answer to http://stackoverflow.com/questions/36867331/cycle-through-classes-on-jquery-to-animate?noredirect=1#comment61340659_36867331
-
Compensating for hidden items
Created for answer to http://stackoverflow.com/questions/34432967/css-how-to-skip-hidden-child-in-nth-childodd-and-nth-childeven
-
Highlighting on hover using class toggling
Created for answer to http://stackoverflow.com/questions/33427460/elegant-way-to-change-css-fill-property-whenever-mouseover-is-triggered
-
Preloading images with Promises
Created for answer to http://stackoverflow.com/questions/33227771/javascript-canvas-for-loops-and-drawimage-not-working-together
-
Event delegation to find a clicked link using .closest
Part of answer for http://stackoverflow.com/questions/26879630/capturing-clicks-on-all-a-tags-using-eventlistener/26880202#26880202
-
Q promise execution order
Created for response to a comment on my answer http://stackoverflow.com/a/22279107/778975
-
Scrolling within an element
Created for part of answer to http://stackoverflow.com/questions/31381109/scroll-to-position-within-a-div-not-window-using-pure-js
-
var a = b = c creates one local variable and two implicit globals
Created for comment on http://stackoverflow.com/a/31109654/778975 and why it is wrong. var a = b = c = 'foo' does not create 3 local variables, it creates one local variable and 2 implicit globals.
-
Toggling instead of using conditionals to swap classes
Created for answer to http://stackoverflow.com/questions/30681243/js-if-else-if-else
-
Removing Element From Array of Arrays with Regex and Array.prototype.filter
Created for answer to http://stackoverflow.com/questions/29908617/removing-element-from-array-of-arrays-with-regex
-
Removing Element From Array of Arrays with Regex
Created for answer to http://stackoverflow.com/questions/29908617/removing-element-from-array-of-arrays-with-regex
-
Modernizing a simple slideshow and extending
Created for answer to http://stackoverflow.com/questions/29909392/slideshow-script-using-php-and-javascript/29942863 explaining how to modernize the slideshow code from http://www.dynamicdrive.com/dynamicindex14/preloadslide.htm