Quick Alphabet Array


var alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');

console.log('this is the letter b...', alphabet[1]);
console.log(alphabet);

The above will output:

this is the letter b... b
["a", "b", "c", "d", "e"...']

In ES6 you could use `let` instead of `var`.

Bring any DOM Element to Top


myEl.parentNode.appendChild(myEl);

Bring myEl to the top within its `parentNode`.

Snippets

For fun I’m gonna port some old actionsnippet.com posts to JavaScript over the next few days… maybe ES5 and 6…