javascript - Internet Explorer 8 - 新 Map() 替换
问题描述
是否有“var exampleMap = new Map();”的简单实现替代?Internet Explorer 8 支持的那个?在我编写应用程序并在 Chrome 中进行测试后,我意识到它不受支持。
我能想出的最佳解决方案是使用 [key, [values]],但它似乎效率极低。
function processData(allText) {
var numOfColumns = 5;
var allTextLines = allText.split(/\r\n|\n/);
return allTextLines;
}
function parseArray(data) {
var allText = processData(data);
var systemApplication = new Map();
for (var i = 1; i < allText.length; i++) {
currentApplicationParameters = allText[i].split(",");
currentApplicationName = currentApplicationParameters[0];
var rsamApplicationProperties = function (entitlementName, environmentName, resourceSequence) {
this.entitlementName = entitlementName;
this.environmentName = environmentName;
this.resourceSequence = resourceSequence;
};
if (systemApplication.has(currentApplicationName)) {
var arrayOfAppParams = [];
arrayOfAppParams = [systemApplication.get(currentApplicationName)];
arrayOfAppParams[0].push(new rsamApplicationProperties(
currentApplicationParameters[1], currentApplicationParameters[3], currentApplicationParameters[2]));
var myNewArray = [].concat.apply([], arrayOfAppParams);
systemApplication.set(currentApplicationName, myNewArray);
} else {
arrayOfAppParams = [new rsamApplicationProperties(currentApplicationParameters[1], currentApplicationParameters[3], currentApplicationParameters[2])];
systemApplication.set(currentApplicationName, arrayOfAppParams);
}
}
解决方案
推荐阅读
- macos - 从命令行杀死 vscode
- c# - 发布到 ARM 上的 Linux 后找不到静态文件
- akka - Akka http 流式传输响应标头
- c# - 如何使用表单身份验证获取 Windows 用户凭据?
- delphi - Delphi 10.2 编辑器中是否有热键可以反转所选文本的大小写?
- powershell - 如何将文件从 azure 存储帐户下载到 power shell 中的临时文件变量
- swift - iOS - 如何从 AppDelegate 中删除 UINavigationController?
- scala - Scala中的动态滑动窗口
- python - 警告:未在 main() 线程中创建 QApplication
- vbscript - cmd中的WScript.Echo输出命令