![](https://img-blog.csdnimg.cn/20201014180756913.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javascript
Lucky爸爸
这个作者很懒,什么都没留下…
展开
-
utils-functions
/** * 如果是 null undefined {} [] "" 则返回 true 其他都是 false * @param value * @returns {boolean} */export const isNilEmpty = (value: any): boolean => { if (_.isString(value)) { return value.length === 0; } if (_.isObject(value)) { return _.原创 2020-10-23 23:52:38 · 277 阅读 · 0 评论 -
js交换数组两项方法
/** * 交换数组两项 * 会直接修改原数组 * 注意这里不处理下标越界的情况 * @param array * @param index1 * @param index2 */export function swap<T extends any[]>(array: T, index1: number, index2: number): void { const tmp = array[index1]; array[index1] = array[index2];原创 2020-09-10 21:05:03 · 676 阅读 · 0 评论