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