小编Sco*_*ole的帖子

为什么需要方括号来在Javascript中对Map的所有元素进行字符串化?

问题:我似乎无法找到一个令人满意的解释,为什么javascript Maps需要使用方括号来使JSON.stringify方法"到达"(?)到嵌套元素中.我想我错过了关于ES6的一些东西,或Map数据类型固有的东西.

我可以将Map转换为对象,并使用stringify-但为什么这个额外的步骤是必要的?

我的实验:

const blah = new Map();

blah.set('u', {
    'something': [{'hey':98}, 56, 'bob']
});

blah.set({
    'hey': {'hey': 78}
}, 'what?');

console.log(JSON.stringify(...blah));

//["u",{}]
//I thought this would yield the result of the below console.log

console.log(JSON.stringify([...blah]))

//[["u",{"something":[{"hey":98},56,"bob"]}],[{"hey":{"hey":78}},"what?"]]
//Why are the square brackets needed to stringify and display each element of 
//the map?
Run Code Online (Sandbox Code Playgroud)

确认的行为,但并没有解释为什么会发生.

javascript json brackets stringify ecmascript-6

6
推荐指数
1
解决办法
140
查看次数

为什么我已从 xcode 项目中删除了 Bundle.Main.localizations 中的本地化内容?

我认为这是一个简单的修复。

当我print(Bundle.main.localizations)

我得到:

["de", "ar", "en", "es", "it", "Base", "fr", "pt-PT"]

但是,我最近删除了阿拉伯字符串文件并从项目中删除了本地化:

在此输入图像描述

如何删除作为本地化之一的阿拉伯语?从用户的角度来看,我不确定这种情况的后果,并且不希望 iTunesConnect/AppStore 发生任何奇怪的事情,例如以某种方式宣传有可用的阿拉伯语本地化,而实际上没有。

xcode localization ios

1
推荐指数
1
解决办法
628
查看次数