私は次のものを持っています:
function getPk(entity) {
var store = window.localStorage;
switch (entity) {
case "City":
if (store.getItem('AccountID')) {
// Need to return both of the below pieces of information
return store.getItem('AccountID') + "04" + "000";
return "CityTable";
} else {
paramOnFailure("Please reselect");
return false;
}
break;
問題は、この関数を呼び出して 2 つの文字列を返す必要があることです。ここでは 2 つの return ステートメントを示していますが、それができないことはわかっています。
getPk(entity) 関数を呼び出す関数に 2 つの文字列を返すきれいな方法はありますか?
可能であれば、返されたものを読み取る方法の例も挙げていただけますか。