code: function _getPrefType(prefItem) {
  
          var finalPrefType = "undefined";
  
          if (prefItem) {
              // check the type parameter.
              var _prefType = prefItem.type;
              if (_prefType !== undefined) {
                  finalPrefType = prefItem.type.toLowerCase();
                  // make sure the initial property's
                  // object type matches to that of 'type' property.
                  if (prefItem.initial !== undefined) {
  
                      if (Array.isArray(prefItem.initial)) {
                          _prefType = "array";
                      } else {
                          var _initialType = typeof (prefItem.initial);
                          _initialType = _initialType.toLowerCase();
                          if (_prefType !== _initialType) {
                              _prefType = _initialType;
                          }
                      }
                  }
              }
  
              if (_prefType) {
                  // preference object's type
                  // is defined. Check if that is valid or not.
                  finalPrefType = _prefType;
                  if (!_isSupportedPrefType(finalPrefType)) {
                      finalPrefType = "undefined";
                  }
              } else if (Array.isArray(prefItem)) {
                  // Check if the object itself
                  // is an array, in which case
                  // we log the default.
                  finalPrefType = "array";
              } else if (prefItem.initial !== undefined  ||
                         prefItem.keys !== undefined) {
  
                  // OK looks like this preference has
                  // no explicit type defined. instead
                  // it needs to be deduced from initial/keys
                  // variable.
                  var _prefVar;
                  if (prefItem.initial !== undefined) {
                      _prefVar = prefItem.initial;
                  } else {
                      _prefVar = prefItem.keys;
                  }
  
                  if (Array.isArray(_prefVar)) {
                      // In cases of array the
                      // typeof is returning a function.
                      finalPrefType = "array";
                  }
  
              } else {
                  finalPrefType = typeof (prefItem);
              }
          }
  
          // Now make sure we recognize this format.
          if (!_isSupportedPrefType(finalPrefType)) {
              finalPrefType = "undefined";
          }
  
          return finalPrefType;
      }
docs: /*
  This method tries to deduce the preference type
  based on various parameters like objects initial
  value, object type, object's type property.