Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / chrome / renderer / resources / extensions / platform_keys / utils.js
blob7bfbbf5392fd579b56c1e8169cbc3861f7746311
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // Returns the intersection of the arrays |a| and |b|, which do not have to be
6 // sorted.
7 function intersect(a, b) {
8 var result = [];
9 for (var i = 0; i < a.length; i++) {
10 if (b.indexOf(a[i]) >= 0)
11 result.push(a[i]);
13 return result;
16 exports.intersect = intersect;