code: function typeOf(value) {
              var s = typeof value;
              if(s === 'object') {
                  if(value) {
                      if(value instanceof Array) {
                          s = 'array';
                      }
                  } else {
                      s = 'null';
                  }
              }
              return s;
          }
docs: Corrected type of value.
  Arrays & null are not 'objects'