该函数期望2019-11-04 11:39:17.179 26830-26830/com.example.myapp D/AuthActivity: 2131230930 == 2131230775 = false
2019-11-04 11:39:17.179 26830-26830/com.example.myapp D/AuthActivity: 2131230930 == 2131230781 = false
2019-11-04 11:39:17.180 26830-26830/com.example.myapp D/AuthActivity: 2131230930 == 2131230782 = false
where 2131230930 is the destination.getId() and (2131230775,2131230781,2131230782) is the resource ids
even when I'm at the destination,the id still doesn't match with the resource id
之间的每个子字符串在&
符号的左侧和右侧都有一个值,例如:
=
被拆分后,foo=fooVal&bar=barVal&baz=bazVal
// ^ ^ ^
所做的是将值放在.map
的左侧作为对象内的键,并将其值放在{{1的右侧}}作为该键的值,例如
=
变成
=
然后foo=fooVal&bar=barVal&baz=bazVal
将这些对象合并为一个:
[
{ foo: 'fooVal' },{ bar: 'barVal' },{ baz: 'bazVal' },]
如果没有.reduce
和{
foo: 'fooVal',bar: 'barVal',baz: 'bazVal',}
,可能更容易理解:
本文链接:https://www.f2er.com/3169204.html