Math.floor

es6的_.unionBy和Math.floor的用法

import * as _ from 'lodash';   const arr= _.unionBy([2.1,1.2,2.9,1.8,3.5,9.6],Math.floor); console.log('arr:'+arr);   返回结果:arr:2.1,1.2,3.5,9.6   unionBy用来对数组去重,   Math.floor返回小于...