我想知道如何匹配字符串與數組,並替換字符串值。匹配字符串數組並替換
我得到_viewID的pageTitle,這需要更改爲更好看的數組名稱。
var pageTitle = [
["ticket_dynamic", "Dynamic ticket page"],
["ticket_regular", "Regular ticket page"],
["cart_regular", "Regular cart page"]
];
var _viewID = _viewID || [];
//_viewID = ticket_dynamic
// _viewID needs to be Dynamic ticket page