Created
July 17, 2010 13:51
-
-
Save padolsey/479517 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// How it probably should be done: | |
var options = Array.prototype.slice.call(arguments), | |
length = options.length, | |
thisObj = options.shift(), | |
script = document.createElement('script'); | |
// How I sometimes do it... | |
var ops = Array.prototype.slice.call(arguments), | |
len = ops.length, | |
hoc = ops.shift(), | |
scr = document.createElement('script'); | |
// Btw, 'hoc' is 'this' in Latin... |
Cool. On tabbing the identifiers, I usually do a one space indent for multi-line var lists. (my coding style has been influenced by bits of PrototypeJS, Andrew Dupont, and Diego Perini)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@jdalton,
I've never encountered an issue with
slice()
(no args), but I guess it wouldn't hurt to add a0
... just in case!I like the idea of moving the
=
... although I might also tab the identifiers so that they line up (not sure if that was a mistake):