JAVASCRIPT   16

filter.js

Guest on 9th June 2021 04:18:15 AM

  1. 'use strict';
  2.  
  3. var aFrom = require('es5-ext/array/from')
  4.  
  5.   , Set = require('../../');
  6.  
  7. module.exports = function (t, a) {
  8.       a.deep(aFrom(t.call(new Set(), Boolean)), [], "Empty set");
  9.       a.deep(aFrom(t.call(new Set([2, 3, 4]), Boolean)), [2, 3, 4], "All true");
  10.       a.deep(aFrom(t.call(new Set([0, false, 4]), Boolean)), [4], "Some false");
  11.       a.deep(aFrom(t.call(new Set([0, false, null]), Boolean)), [], "All false");
  12. };

Raw Paste


Login or Register to edit or fork this paste. It's free.