You could reduce the array by adding the result of compairing the numerical values.
var arrA = ["6", "2", "21", "8", "4", "12"],
arrB = ["8", "2", "12", "2", "5", "11"],
count = arrA.reduce((c, v, i) => c + (+v > +arrB[i]), 0);
console.log(count);
More Related Contents:
- Array value is replaced when second one stores in php
- Javascript Array – Split string at numbers [closed]
- JS join arrays with replacement
- Array Split in JavaScript [closed]
- Merge/flatten an array of arrays
- How to get the difference between two arrays in JavaScript?
- Rotate the elements in an array in JavaScript
- Convert base64 string to ArrayBuffer
- What does [].forEach.call() do in JavaScript?
- How to split a long array into smaller arrays, with JavaScript
- Remove items from array with splice in for loop [duplicate]
- Map and filter an array at the same time
- How to replace item in array?
- What is array literal notation in javascript and when should you use it?
- Compute intersection of two arrays in JavaScript [duplicate]
- How can I ignore certain returned values from array destructuring?
- Filtering array of objects by searching nested object properties
- Convert string array to array in javascript
- Difference between Array.length = 0 and Array =[]?
- How to calculate intersection of multiple arrays in JavaScript? And what does [equals: function] mean?
- console.log(result) prints [object Object]. How do I get result.name? [duplicate]
- Convert an array to an array of objects
- use Lodash to sort array of object by value
- Javascript – Loop through array backwards with forEach
- Determining whether one array contains the contents of another array in JavaScript/CoffeeScript
- JavaScript foreach loop on an associative array object
- Why can’t I check if an array is empty with array == []?
- javascript – find unique objects in array based on multiple properties
- How do I get the last 5 elements, excluding the first element from an array?
- JavaScript is in array [duplicate]