Skip to content

Instantly share code, notes, and snippets.

@inimino
Forked from ELLIOTTCABLE/style-1.js
Created December 19, 2009 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save inimino/260115 to your computer and use it in GitHub Desktop.
Save inimino/260115 to your computer and use it in GitHub Desktop.
function () {
if (typeof exports !== 'undefined') { from = exports }
else { from = new(Object) };
}
function () {
if (typeof exports !== 'undefined') { from = exports }
else { from = new(Object) };
}
function () {
if (typeof exports !== 'undefined') { from = exports }
else { from = new(Object) };
}
function () {
if (typeof exports !== 'undefined') {
from = exports }
else {
from = new(Object) };
}
function () {
if (typeof exports !== 'undefined') {
from = exports } else {
from = new(Object) };
}
function () {
if (typeof exports !== 'undefined') {
from = exports
} else {
from = new(Object)
};
}
// #7
// only changing whitespace and not the code itself, this is how I would most likely write it:
function(){
if(typeof exports !== 'undefined') from=exports
else from=new Object}
// #8
// the is #2, with the closing brace moved; I like this one also
function(){
if (typeof exports !== 'undefined') { from = exports }
else { from = new(Object) }}
// #9
// when there is a shorter solution, I often will put the function on one line:
function(){from = typeof exports=='undefined' ?{} :exports}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment