@EricDunaway/

compare arrays

Nodejs

No description

fork
loading
Files
  • index.js
  • package-lock.json
  • package.json
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
const {equals,length,sum,zipWith, and} = require('ramda');

const equalArrays = (a, b) =>
  and(equals(length(a),length(b)),equals(sum(zipWith(equals, a, b)),length(a)))


  console.log('#1',equalArrays([1,2],[1,2]))
  console.log('#2',equalArrays([1,2],[1,,2,2]))
  console.log('#3',equalArrays([1,2],[1,2,2]))
  console.log('#4',equalArrays([1,2,3],[1,2]))
  console.log('#5',equalArrays([1,2,3,4],[1,2,3]))

  'exit'
node v10.16.0