1.0.0 • Published 2 years ago
yida-utils2 v1.0.0
作用
求数组最大值,最小值,打印数组,日期格式化为字符串
安装
npm install yida-utils
使用演示
const yida = require('./index.js');
//求数组最大值
let arr = [12, 3, 18, 90, 1, 200, 900, 30];
const maxVal = yida.maxValue(arr);
console.log(maxVal);
//求数组最小值
const minVal = yida.minValue(arr);
console.log(minVal);
//打印数组
yida.print(arr);
//日期对象转成日期字符串
const date = yida.format(new Date());//当前系统时间
console.log(date);
开源协议
ISC
1.0.0
2 years ago