Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js 哪个更快:(arr.contains(val)|$.inArray(val,arr))?_Ember.js - Fatal编程技术网

Ember.js 哪个更快:(arr.contains(val)|$.inArray(val,arr))?

Ember.js 哪个更快:(arr.contains(val)|$.inArray(val,arr))?,ember.js,Ember.js,哪个更快 arr.contains(val); 或 有准确的测试方法吗?如果你想找一个简单的方法来测试JS,我建议使用jsperf.com。如果你想找一个简单的方法来测试JS,我建议使用jsperf.com。@Adriano-它是一个余烬函数@Adriano-它是一个余烬函数 $.inArray(val, arr);

哪个更快

arr.contains(val);


有准确的测试方法吗?

如果你想找一个简单的方法来测试JS,我建议使用jsperf.com。

如果你想找一个简单的方法来测试JS,我建议使用jsperf.com。

@Adriano-它是一个余烬函数@Adriano-它是一个余烬函数
$.inArray(val, arr);