Designing a public API for a JavaScript module
It seems to me that it'd be simpler to always use JSON, rather than limit yourself to strings and arrays, specifically.

E.g.

function retrieve(key) {
  var json = localStorage.getItem(key);
  try {
    return JSON.parse(json).value;
  } catch(e) {
    return json; // either null or a non-comforming value
  }
}

function store(key, value) {
  var json = JSON.stringify({ value: value });
  localStorage.setItem(key, json);
}


This will let you store and retrieve any JSON-serializable value including strings and arrays. You can wrap/namespace it however you like.