1.0.0 • Published 1 year ago

yidahulian-utils1 v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

作用

求数组最大值,最小值,打印数组,日期格式化为字符串

安装

npm install yida-utils

使用演示

const yida = require('./index.js');n

//获取数组中的最大值
let arr = [11, 44, 123, 554, 2331, 56543, 23324];
const maxVal = yida.maxValue(arr);
console.log(maxVal);

//获取数组中的最小值
const minVal = yida.minValue(arr);
console.log(minVal);

//打印数组
yida.print(arr);

//日期格式化为日期字符串
const str = yida.format(new Date());
console.log(str);

开源协议

ISC