0
我想了解HomeAssistant前端源代码。我发现我不明白的函数定义。我不明白这句法(model.entity是一个字符串)...这个箭头函数代码是什么意思?
export function createHasDataGetter(model) {
return [
['restApiCache', model.entity],
entityMap => !!entityMap,
];
}
看起来像水木清华:
return [[string, string], bool]
?
什么是这个函数的exacly teturn类型?这只是布尔?如果是,是否意味着entityMap是字符串数组?
如果您已经知道这是一个箭头功能,您对此感到困惑吗?好像你已经知道这是一个函数而不是'bool'。 – 2016-08-03 14:52:59
Duplicate of:http://stackoverflow.com/questions/24900875/whats-the-meaning-of-an-arrow-formed-from-equals-greater-than-in-javas?noredirect=1&lq=1 – Paulpro
'entityMap => !! entityMap'相当于'function(entityMap){return !! entityMap; }' – Paulpro