2016-03-25 2 views
-2

以下の文脈で(a =>)は何をしますか?=> doとは何ですか?また、以下の文脈では何を呼びますか?

function findOutlier(int){ 
    var even = int.filter(a=>a%2==0); 
    var odd = int.filter(a=>a%2!==0); 
    return even.length==1? even[0] : odd[0]; 
} 
+1

と同じです[矢印機能。(https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)私は良い感じを得るために[この質問](http://stackoverflow.com/questions/34361379/arrow-function-vs-function-declaration-expressions-are-theequivalent-exch)を読むことをお勧めしたい彼らのために。 –

答えて

関連する問題